diff options
Diffstat (limited to 'spec/frontend/issues/show/components/incidents/incident_tabs_spec.js')
-rw-r--r-- | spec/frontend/issues/show/components/incidents/incident_tabs_spec.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/spec/frontend/issues/show/components/incidents/incident_tabs_spec.js b/spec/frontend/issues/show/components/incidents/incident_tabs_spec.js index 35acca60de7..8e090645be2 100644 --- a/spec/frontend/issues/show/components/incidents/incident_tabs_spec.js +++ b/spec/frontend/issues/show/components/incidents/incident_tabs_spec.js @@ -5,6 +5,7 @@ import { trackIncidentDetailsViewsOptions } from '~/incidents/constants'; import DescriptionComponent from '~/issues/show/components/description.vue'; import HighlightBar from '~/issues/show/components/incidents/highlight_bar.vue'; import IncidentTabs from '~/issues/show/components/incidents/incident_tabs.vue'; +import TimelineTab from '~/issues/show/components/incidents/timeline_events_tab.vue'; import INVALID_URL from '~/lib/utils/invalid_url'; import Tracking from '~/tracking'; import AlertDetailsTable from '~/vue_shared/components/alert_details_table.vue'; @@ -35,8 +36,9 @@ describe('Incident Tabs component', () => { fullPath: '', iid: '', projectId: '', + issuableId: '', uploadMetricsFeatureAvailable: true, - glFeatures: { incidentTimeline: true, incidentTimelineEvents: true }, + glFeatures: { incidentTimeline: true }, }, data() { return { alert: mockAlert, ...data }; @@ -47,6 +49,9 @@ describe('Incident Tabs component', () => { alert: { loading: true, }, + timelineEvents: { + loading: false, + }, }, }, }, @@ -62,6 +67,7 @@ describe('Incident Tabs component', () => { const findAlertDetailsComponent = () => wrapper.find(AlertDetailsTable); const findDescriptionComponent = () => wrapper.find(DescriptionComponent); const findHighlightBarComponent = () => wrapper.find(HighlightBar); + const findTimelineTab = () => wrapper.findComponent(TimelineTab); describe('empty state', () => { beforeEach(() => { @@ -122,4 +128,20 @@ describe('Incident Tabs component', () => { expect(Tracking.event).toHaveBeenCalledWith(category, action); }); }); + + describe('incident timeline tab', () => { + beforeEach(() => { + mountComponent(); + }); + + it('renders the timeline tab when feature flag is enabled', () => { + expect(findTimelineTab().exists()).toBe(true); + }); + + it('does not render timeline tab when feature flag is disabled', () => { + mountComponent({}, { provide: { glFeatures: { incidentTimeline: false } } }); + + expect(findTimelineTab().exists()).toBe(false); + }); + }); }); |