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
95ce733d
Commit
95ce733d
authored
Apr 09, 2022
by
Tristan Read
Committed by
Sean Arnold
Apr 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add full mount spec for alert metric image tab
parent
d40ac8ff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
spec/frontend/vue_shared/alert_details/alert_details_spec.js
spec/frontend/vue_shared/alert_details/alert_details_spec.js
+23
-3
No files found.
spec/frontend/vue_shared/alert_details/alert_details_spec.js
View file @
95ce733d
...
...
@@ -13,12 +13,16 @@ import { PAGE_CONFIG, SEVERITY_LEVELS } from '~/vue_shared/alert_details/constan
import
createIssueMutation
from
'
~/vue_shared/alert_details/graphql/mutations/alert_issue_create.mutation.graphql
'
;
import
AlertDetailsTable
from
'
~/vue_shared/components/alert_details_table.vue
'
;
import
MetricImagesTab
from
'
~/vue_shared/components/metric_images/metric_images_tab.vue
'
;
import
createStore
from
'
~/vue_shared/components/metric_images/store/
'
;
import
service
from
'
~/vue_shared/alert_details/service
'
;
import
mockAlerts
from
'
./mocks/alerts.json
'
;
const
mockAlert
=
mockAlerts
[
0
];
const
environmentName
=
'
Production
'
;
const
environmentPath
=
'
/fake/path
'
;
jest
.
mock
(
'
~/vue_shared/alert_details/service
'
);
describe
(
'
AlertDetails
'
,
()
=>
{
let
environmentData
=
{
name
:
environmentName
,
path
:
environmentPath
};
let
mock
;
...
...
@@ -68,10 +72,11 @@ describe('AlertDetails', () => {
$route
:
{
params
:
{}
},
},
stubs
:
{
...
stubs
,
AlertSummaryRow
,
'
metric-images-tab
'
:
true
,
...
stubs
,
},
store
:
createStore
({},
service
),
}),
);
}
...
...
@@ -131,8 +136,21 @@ describe('AlertDetails', () => {
expect
(
wrapper
.
findByTestId
(
'
startTimeItem
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
findByTestId
(
'
startTimeItem
'
).
props
(
'
time
'
)).
toBe
(
mockAlert
.
startedAt
);
});
});
describe
(
'
Metrics tab
'
,
()
=>
{
it
(
'
should mount without errors
'
,
()
=>
{
mountComponent
({
mountMethod
:
mount
,
provide
:
{
canUpdate
:
true
,
iid
:
'
1
'
,
},
stubs
:
{
MetricImagesTab
,
},
});
it
(
'
renders the metrics tab
'
,
()
=>
{
expect
(
findMetricsTab
().
exists
()).
toBe
(
true
);
});
});
...
...
@@ -314,7 +332,9 @@ describe('AlertDetails', () => {
describe
(
'
header
'
,
()
=>
{
const
findHeader
=
()
=>
wrapper
.
findByTestId
(
'
alert-header
'
);
const
stubs
=
{
TimeAgoTooltip
:
{
template
:
'
<span>now</span>
'
}
};
const
stubs
=
{
TimeAgoTooltip
:
{
template
:
'
<span>now</span>
'
},
};
describe
(
'
individual header fields
'
,
()
=>
{
describe
.
each
`
...
...
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