Commit a0e66854 authored by Mark Florian's avatar Mark Florian

Merge branch '358401-leipert-fix-broken-foss-test' into 'master'

Fix broken FOSS jest tests

See merge request gitlab-org/gitlab!84719
parents 345f8e95 a8b2fb75
......@@ -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