Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b5357b2b
Commit
b5357b2b
authored
Apr 08, 2021
by
Quang-Minh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor frontend tests
parent
db49f207
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
57 deletions
+47
-57
spec/frontend/performance_bar/components/detailed_metric_spec.js
...ontend/performance_bar/components/detailed_metric_spec.js
+47
-57
No files found.
spec/frontend/performance_bar/components/detailed_metric_spec.js
View file @
b5357b2b
...
@@ -120,80 +120,70 @@ describe('detailedMetric', () => {
...
@@ -120,80 +120,70 @@ describe('detailedMetric', () => {
});
});
});
});
describe
(
'
when the details have summaryOptions > hideTotal option
'
,
()
=>
{
describe
(
'
when the details have summaryOptions option
'
,
()
=>
{
beforeEach
(()
=>
{
const
gitalyDetails
=
{
createComponent
({
duration
:
'
123ms
'
,
currentRequest
:
{
calls
:
456
,
details
:
{
details
:
requestDetails
,
gitaly
:
{
warnings
:
[
'
gitaly calls: 456 over 30
'
],
duration
:
'
123ms
'
,
};
calls
:
456
,
details
:
requestDetails
,
describe
(
'
when the details have summaryOptions > hideTotal option
'
,
()
=>
{
warnings
:
[
'
gitaly calls: 456 over 30
'
],
beforeEach
(()
=>
{
summaryOptions
:
{
createComponent
({
hideTotal
:
true
,
currentRequest
:
{
},
details
:
{
gitaly
:
{
...
gitalyDetails
,
summaryOptions
:
{
hideTotal
:
true
}
},
},
},
},
},
}
,
}
);
});
});
});
it
(
'
displays a summary section
'
,
()
=>
{
it
(
'
displays a summary section
'
,
()
=>
{
expect
(
findAllSummaryItems
()).
toEqual
([
'
Total duration 123ms
'
]);
expect
(
findAllSummaryItems
()).
toEqual
([
'
Total duration 123ms
'
]);
});
});
});
});
describe
(
'
when the details have summaryOptions > hideDuration option
'
,
()
=>
{
describe
(
'
when the details have summaryOptions > hideDuration option
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponent
({
createComponent
({
currentRequest
:
{
currentRequest
:
{
details
:
{
details
:
{
gitaly
:
{
gitaly
:
{
...
gitalyDetails
,
summaryOptions
:
{
hideDuration
:
true
}
},
duration
:
'
123ms
'
,
calls
:
456
,
details
:
requestDetails
,
warnings
:
[
'
gitaly calls: 456 over 30
'
],
summaryOptions
:
{
hideDuration
:
true
,
},
},
},
},
},
}
,
}
);
});
});
});
it
(
'
displays a summary section
'
,
()
=>
{
it
(
'
displays a summary section
'
,
()
=>
{
expect
(
findAllSummaryItems
()).
toEqual
([
'
Total 456
'
]);
expect
(
findAllSummaryItems
()).
toEqual
([
'
Total 456
'
]);
});
});
});
});
describe
(
'
when the details have both summary and summaryOptions field
'
,
()
=>
{
describe
(
'
when the details have both summary and summaryOptions field
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponent
({
createComponent
({
currentRequest
:
{
currentRequest
:
{
details
:
{
details
:
{
gitaly
:
{
gitaly
:
{
duration
:
'
123ms
'
,
...
gitalyDetails
,
calls
:
456
,
summary
:
{
details
:
requestDetails
,
'
In controllers
'
:
100
,
warnings
:
[
'
gitaly calls: 456 over 30
'
],
'
In middlewares
'
:
20
,
summary
:
{
},
'
In controllers
'
:
100
,
summaryOptions
:
{
'
In middlewares
'
:
20
,
hideDuration
:
true
,
},
hideTotal
:
true
,
summaryOptions
:
{
},
hideDuration
:
true
,
hideTotal
:
true
,
},
},
},
},
},
},
}
,
}
);
});
});
});
it
(
'
displays a summary section
'
,
()
=>
{
it
(
'
displays a summary section
'
,
()
=>
{
expect
(
findAllSummaryItems
()).
toEqual
([
'
In controllers 100
'
,
'
In middlewares 20
'
]);
expect
(
findAllSummaryItems
()).
toEqual
([
'
In controllers 100
'
,
'
In middlewares 20
'
]);
});
});
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment