Commit a8b2fb75 authored by Lukas Eipert's avatar Lukas Eipert

Fix broken FOSS jest tests

With https://gitlab.com/gitlab-org/gitlab/-/merge_requests/84121 a few
things got refactored, and a lot of things moved to FOSS. One of the
specs for the EE Only `IncidentMetricTab` was moved to FOSS as well.
Moving the spec back to EE fixes the issue.
parent 683c0926
......@@ -51,6 +51,7 @@ describe('Incident Tabs component', () => {
};
const findTimelineTab = () => wrapper.find('[data-testid="timeline-events-tab"]');
const findMetricsTab = () => wrapper.find('[data-testid="metrics-tab"]');
describe('incident timeline tab', () => {
beforeEach(() => {
......@@ -74,4 +75,18 @@ describe('Incident Tabs component', () => {
expect(findTimelineTab().exists()).toBe(false);
});
});
describe('upload metrics feature available', () => {
it('shows the metric tab when metrics are available', () => {
mountComponent({}, { provide: { uploadMetricsFeatureAvailable: true } });
expect(findMetricsTab().exists()).toBe(true);
});
it('hides the tab when metrics are not available', () => {
mountComponent({}, { provide: { uploadMetricsFeatureAvailable: false } });
expect(findMetricsTab().exists()).toBe(false);
});
});
});
......@@ -58,7 +58,6 @@ describe('Incident Tabs component', () => {
const findTabs = () => wrapper.findAll(GlTab);
const findSummaryTab = () => findTabs().at(0);
const findMetricsTab = () => wrapper.find('[data-testid="metrics-tab"]');
const findAlertDetailsTab = () => wrapper.find('[data-testid="alert-details-tab"]');
const findAlertDetailsComponent = () => wrapper.find(AlertDetailsTable);
const findDescriptionComponent = () => wrapper.find(DescriptionComponent);
......@@ -112,20 +111,6 @@ describe('Incident Tabs component', () => {
});
});
describe('upload metrics feature available', () => {
it('shows the metric tab when metrics are available', () => {
mountComponent({}, { provide: { uploadMetricsFeatureAvailable: true } });
expect(findMetricsTab().exists()).toBe(true);
});
it('hides the tab when metrics are not available', () => {
mountComponent({}, { provide: { uploadMetricsFeatureAvailable: false } });
expect(findMetricsTab().exists()).toBe(false);
});
});
describe('Snowplow tracking', () => {
beforeEach(() => {
jest.spyOn(Tracking, 'event');
......
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