Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ebdfe06a
Commit
ebdfe06a
authored
Mar 02, 2022
by
peterhegman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move spec to `ee` directory to fix `jest-as-if-foss` job
CE spec referenced an EE component
parent
eb26e0ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
24 deletions
+76
-24
ee/spec/frontend/issues/show/components/incidents/incident_tabs_spec.js
...nd/issues/show/components/incidents/incident_tabs_spec.js
+76
-0
spec/frontend/issues/show/components/incidents/incident_tabs_spec.js
...nd/issues/show/components/incidents/incident_tabs_spec.js
+0
-24
No files found.
ee/spec/frontend/issues/show/components/incidents/incident_tabs_spec.js
0 → 100644
View file @
ebdfe06a
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
merge
from
'
lodash/merge
'
;
import
IncidentTabs
from
'
~/issues/show/components/incidents/incident_tabs.vue
'
;
import
INVALID_URL
from
'
~/lib/utils/invalid_url
'
;
import
{
descriptionProps
}
from
'
jest/issues/show/mock_data/mock_data
'
;
const
mockAlert
=
{
__typename
:
'
AlertManagementAlert
'
,
detailsUrl
:
INVALID_URL
,
iid
:
'
1
'
,
};
describe
(
'
Incident Tabs component
'
,
()
=>
{
let
wrapper
;
const
mountComponent
=
(
data
=
{},
options
=
{})
=>
{
wrapper
=
shallowMount
(
IncidentTabs
,
merge
(
{
propsData
:
{
...
descriptionProps
,
},
stubs
:
{
DescriptionComponent
:
true
,
MetricsTab
:
true
,
},
provide
:
{
fullPath
:
''
,
iid
:
''
,
uploadMetricsFeatureAvailable
:
true
,
glFeatures
:
{
incidentTimelineEventTab
:
true
,
incidentTimelineEvents
:
true
},
},
data
()
{
return
{
alert
:
mockAlert
,
...
data
};
},
mocks
:
{
$apollo
:
{
queries
:
{
alert
:
{
loading
:
true
,
},
},
},
},
},
options
,
),
);
};
const
findTimelineTab
=
()
=>
wrapper
.
find
(
'
[data-testid="timeline-events-tab"]
'
);
describe
(
'
incident timeline tab
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
();
});
it
(
'
renders the timeline tab when feature flag is enabled
'
,
()
=>
{
expect
(
findTimelineTab
().
exists
()).
toBe
(
true
);
expect
(
findTimelineTab
().
attributes
(
'
title
'
)).
toBe
(
'
Timeline
'
);
});
it
(
'
does not render timeline tab when feature flag is disabled
'
,
()
=>
{
mountComponent
({},
{
provide
:
{
glFeatures
:
{
incidentTimelineEventTab
:
false
}
}
});
expect
(
findTimelineTab
().
exists
()).
toBe
(
false
);
});
it
(
'
does not render timeline tab when not available in license
'
,
()
=>
{
mountComponent
({},
{
provide
:
{
glFeatures
:
{
incidentTimelineEvents
:
false
}
}
});
expect
(
findTimelineTab
().
exists
()).
toBe
(
false
);
});
});
});
spec/frontend/issues/show/components/incidents/incident_tabs_spec.js
View file @
ebdfe06a
...
...
@@ -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
findTimelineTab
=
()
=>
wrapper
.
find
(
'
[data-testid="timeline-events-tab"]
'
);
const
findAlertDetailsTab
=
()
=>
wrapper
.
find
(
'
[data-testid="alert-details-tab"]
'
);
const
findAlertDetailsComponent
=
()
=>
wrapper
.
find
(
AlertDetailsTable
);
const
findDescriptionComponent
=
()
=>
wrapper
.
find
(
DescriptionComponent
);
...
...
@@ -74,29 +73,6 @@ describe('Incident Tabs component', () => {
});
});
describe
(
'
incident timeline tab
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
();
});
it
(
'
renders the timeline tab when feature flag is enabled
'
,
()
=>
{
expect
(
findTimelineTab
().
exists
()).
toBe
(
true
);
expect
(
findTimelineTab
().
attributes
(
'
title
'
)).
toBe
(
'
Timeline
'
);
});
it
(
'
does not render timeline tab when feature flag is disabled
'
,
()
=>
{
mountComponent
({},
{
provide
:
{
glFeatures
:
{
incidentTimelineEventTab
:
false
}
}
});
expect
(
findTimelineTab
().
exists
()).
toBe
(
false
);
});
it
(
'
does not render timeline tab when not available in license
'
,
()
=>
{
mountComponent
({},
{
provide
:
{
glFeatures
:
{
incidentTimelineEvents
:
false
}
}
});
expect
(
findTimelineTab
().
exists
()).
toBe
(
false
);
});
});
describe
(
'
with an alert present
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment