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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
3372ae8b
Commit
3372ae8b
authored
Aug 09, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ci skip] Adds unit tests for issue_system_note component
parent
02c66dad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
4 deletions
+40
-4
spec/javascripts/notes/components/issue_system_note_spec.js
spec/javascripts/notes/components/issue_system_note_spec.js
+40
-4
No files found.
spec/javascripts/notes/components/issue_system_note_spec.js
View file @
3372ae8b
import
Vue
from
'
vue
'
;
import
issueSystemNote
from
'
~/notes/components/issue_system_note.vue
'
;
import
store
from
'
~/notes/stores
'
;
describe
(
'
issue system note
'
,
()
=>
{
it
(
'
should render a list item with correct id
'
,
()
=>
{
let
vm
;
let
props
;
beforeEach
(()
=>
{
props
=
{
note
:
{
id
:
1424
,
author
:
{
id
:
1
,
name
:
'
Root
'
,
username
:
'
root
'
,
state
:
'
active
'
,
avatar_url
:
'
path
'
,
path
:
'
/root
'
,
},
note_html
:
'
<p dir="auto">closed</p>
'
,
system_note_icon_name
:
'
icon_status_closed
'
,
created_at
:
'
2017-08-02T10:51:58.559Z
'
,
},
};
store
.
dispatch
(
'
setTargetNoteHash
'
,
`note_
${
props
.
note
.
id
}
`
);
const
Component
=
Vue
.
extend
(
issueSystemNote
);
vm
=
new
Component
({
store
,
propsData
:
props
,
}).
$mount
();
});
it
(
'
should render target class is note is target note
'
,
()
=>
{
it
(
'
should render a list item with correct id
'
,
()
=>
{
expect
(
vm
.
$el
.
getAttribute
(
'
id
'
)).
toEqual
(
`note_
${
props
.
note
.
id
}
`
);
});
it
(
'
should render target class is note is target note
'
,
()
=>
{
expect
(
vm
.
$el
.
classList
).
toContain
(
'
target
'
);
});
it
(
'
should render svg icon
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.timeline-icon svg
'
)).
toBeDefined
();
});
it
(
'
should render note header component
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.system-note-message
'
).
innerHTML
,
).
toEqual
(
props
.
note
.
note_html
);
});
});
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