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
7b34487e
Commit
7b34487e
authored
Nov 19, 2019
by
Enrique Alcantara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare system notes spec for bv upgrade
parent
dbd0a8b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
spec/frontend/vue_shared/components/notes/system_note_spec.js
.../frontend/vue_shared/components/notes/system_note_spec.js
+14
-10
No files found.
spec/frontend/vue_shared/components/notes/system_note_spec.js
View file @
7b34487e
import
Vue
from
'
vue
'
;
import
i
ssueSystemNote
from
'
~/vue_shared/components/notes/system_note.vue
'
;
import
{
createLocalVue
,
mount
}
from
'
@vue/test-utils
'
;
import
I
ssueSystemNote
from
'
~/vue_shared/components/notes/system_note.vue
'
;
import
createStore
from
'
~/notes/stores
'
;
import
initMRPopovers
from
'
~/mr_popover/index
'
;
jest
.
mock
(
'
~/mr_popover/index
'
,
()
=>
jest
.
fn
());
const
localVue
=
createLocalVue
();
describe
(
'
system note component
'
,
()
=>
{
let
vm
;
let
props
;
...
...
@@ -30,34 +32,36 @@ describe('system note component', () => {
const
store
=
createStore
();
store
.
dispatch
(
'
setTargetNoteHash
'
,
`note_
${
props
.
note
.
id
}
`
);
const
Component
=
Vue
.
extend
(
issueSystemNote
);
vm
=
new
Component
({
vm
=
mount
(
IssueSystemNote
,
{
store
,
localVue
,
propsData
:
props
,
}).
$mount
();
attachToDocument
:
true
,
sync
:
false
,
});
});
afterEach
(()
=>
{
vm
.
$
destroy
();
vm
.
destroy
();
});
it
(
'
should render a list item with correct id
'
,
()
=>
{
expect
(
vm
.
$el
.
getAttribute
(
'
id
'
)).
toEqual
(
`note_
${
props
.
note
.
id
}
`
);
expect
(
vm
.
attributes
(
'
id
'
)).
toEqual
(
`note_
${
props
.
note
.
id
}
`
);
});
it
(
'
should render target class is note is target note
'
,
()
=>
{
expect
(
vm
.
$el
.
classList
).
toContain
(
'
target
'
);
expect
(
vm
.
classes
()
).
toContain
(
'
target
'
);
});
it
(
'
should render svg icon
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.timeline-icon svg
'
)).
toBeDefined
(
);
expect
(
vm
.
find
(
'
.timeline-icon svg
'
).
exists
()).
toBe
(
true
);
});
// Redcarpet Markdown renderer wraps text in `<p>` tags
// we need to strip them because they break layout of commit lists in system notes:
// https://gitlab.com/gitlab-org/gitlab-foss/uploads/b07a10670919254f0220d3ff5c1aa110/jqzI.png
it
(
'
removes wrapping paragraph from note HTML
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.system-note-message
'
).
innerHTML
).
toContain
(
'
<span>closed</span>
'
);
expect
(
vm
.
find
(
'
.system-note-message
'
).
html
()
).
toContain
(
'
<span>closed</span>
'
);
});
it
(
'
should initMRPopovers onMount
'
,
()
=>
{
...
...
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