Commit b5357b2b authored by Quang-Minh Nguyen's avatar Quang-Minh Nguyen

Refactor frontend tests

parent db49f207
......@@ -120,20 +120,20 @@ describe('detailedMetric', () => {
});
});
describe('when the details have summaryOptions option', () => {
const gitalyDetails = {
duration: '123ms',
calls: 456,
details: requestDetails,
warnings: ['gitaly calls: 456 over 30'],
};
describe('when the details have summaryOptions > hideTotal option', () => {
beforeEach(() => {
createComponent({
currentRequest: {
details: {
gitaly: {
duration: '123ms',
calls: 456,
details: requestDetails,
warnings: ['gitaly calls: 456 over 30'],
summaryOptions: {
hideTotal: true,
},
},
gitaly: { ...gitalyDetails, summaryOptions: { hideTotal: true } },
},
},
});
......@@ -149,15 +149,7 @@ describe('detailedMetric', () => {
createComponent({
currentRequest: {
details: {
gitaly: {
duration: '123ms',
calls: 456,
details: requestDetails,
warnings: ['gitaly calls: 456 over 30'],
summaryOptions: {
hideDuration: true,
},
},
gitaly: { ...gitalyDetails, summaryOptions: { hideDuration: true } },
},
},
});
......@@ -174,10 +166,7 @@ describe('detailedMetric', () => {
currentRequest: {
details: {
gitaly: {
duration: '123ms',
calls: 456,
details: requestDetails,
warnings: ['gitaly calls: 456 over 30'],
...gitalyDetails,
summary: {
'In controllers': 100,
'In middlewares': 20,
......@@ -196,6 +185,7 @@ describe('detailedMetric', () => {
expect(findAllSummaryItems()).toEqual(['In controllers 100', 'In middlewares 20']);
});
});
});
describe("when the details don't have a start field", () => {
beforeEach(() => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment