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
150e626d
Commit
150e626d
authored
Apr 20, 2020
by
Dave Pisek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add snapshot tests
parent
5c1f11f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
1 deletion
+66
-1
app/assets/javascripts/reports/components/issue_status_icon.vue
...sets/javascripts/reports/components/issue_status_icon.vue
+0
-1
spec/frontend/reports/components/__snapshots__/issue_status_icon_spec.js.snap
...s/components/__snapshots__/issue_status_icon_spec.js.snap
+37
-0
spec/frontend/reports/components/issue_status_icon_spec.js
spec/frontend/reports/components/issue_status_icon_spec.js
+29
-0
No files found.
app/assets/javascripts/reports/components/issue_status_icon.vue
View file @
150e626d
...
...
@@ -8,7 +8,6 @@ export default {
Icon
,
},
props
:
{
// failed || success
status
:
{
type
:
String
,
required
:
true
,
...
...
spec/frontend/reports/components/__snapshots__/issue_status_icon_spec.js.snap
0 → 100644
View file @
150e626d
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`IssueStatusIcon renders "failed" state correctly 1`] = `
<div
class="report-block-list-icon failed"
>
<icon-stub
data-qa-selector="status_failed_icon"
name="status_failed_borderless"
size="24"
/>
</div>
`;
exports[`IssueStatusIcon renders "neutral" state correctly 1`] = `
<div
class="report-block-list-icon neutral"
>
<icon-stub
data-qa-selector="status_neutral_icon"
name="dash"
size="24"
/>
</div>
`;
exports[`IssueStatusIcon renders "success" state correctly 1`] = `
<div
class="report-block-list-icon success"
>
<icon-stub
data-qa-selector="status_success_icon"
name="status_success_borderless"
size="24"
/>
</div>
`;
spec/frontend/reports/components/issue_status_icon_spec.js
0 → 100644
View file @
150e626d
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
ReportItem
from
'
~/reports/components/issue_status_icon.vue
'
;
import
{
STATUS_FAILED
,
STATUS_NEUTRAL
,
STATUS_SUCCESS
}
from
'
~/reports/constants
'
;
describe
(
'
IssueStatusIcon
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
({
status
})
=>
{
wrapper
=
shallowMount
(
ReportItem
,
{
propsData
:
{
status
,
},
});
};
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
it
.
each
([
STATUS_SUCCESS
,
STATUS_NEUTRAL
,
STATUS_FAILED
])(
'
renders "%s" state correctly
'
,
status
=>
{
createComponent
({
status
});
expect
(
wrapper
.
element
).
toMatchSnapshot
();
},
);
});
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