Commit 7dacf1bd authored by Alexander Turinske's avatar Alexander Turinske

Fix Metric tab not showing up on operations page

- fix broken test
- add additional test
parent 3262be6b
...@@ -368,7 +368,7 @@ export default { ...@@ -368,7 +368,7 @@ export default {
<alert-details-table :alert="alert" :loading="loading" /> <alert-details-table :alert="alert" :loading="loading" />
</gl-tab> </gl-tab>
<gl-tab <gl-tab
v-if="isThreatMonitoringPage" v-if="!isThreatMonitoringPage"
:data-testid="$options.tabsConfig[1].id" :data-testid="$options.tabsConfig[1].id"
:title="$options.tabsConfig[1].title" :title="$options.tabsConfig[1].title"
> >
......
---
title: Fix Metric tab not showing up on operations page
merge_request: 54736
author:
type: fixed
...@@ -128,6 +128,10 @@ describe('AlertDetails', () => { ...@@ -128,6 +128,10 @@ describe('AlertDetails', () => {
expect(wrapper.findByTestId('startTimeItem').exists()).toBe(true); expect(wrapper.findByTestId('startTimeItem').exists()).toBe(true);
expect(wrapper.findByTestId('startTimeItem').props('time')).toBe(mockAlert.startedAt); expect(wrapper.findByTestId('startTimeItem').props('time')).toBe(mockAlert.startedAt);
}); });
it('renders the metrics tab', () => {
expect(findMetricsTab().exists()).toBe(true);
});
}); });
describe('individual alert fields', () => { describe('individual alert fields', () => {
...@@ -179,7 +183,8 @@ describe('AlertDetails', () => { ...@@ -179,7 +183,8 @@ describe('AlertDetails', () => {
describe('Threat Monitoring details', () => { describe('Threat Monitoring details', () => {
it('should not render the metrics tab', () => { it('should not render the metrics tab', () => {
mountComponent({ mountComponent({
data: { alert: mockAlert, provide: { isThreatMonitoringPage: true } }, data: { alert: mockAlert },
provide: { isThreatMonitoringPage: true },
}); });
expect(findMetricsTab().exists()).toBe(false); expect(findMetricsTab().exists()).toBe(false);
}); });
......
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