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
Boxiang Sun
gitlab-ce
Commits
f5461d7b
Commit
f5461d7b
authored
Jul 03, 2019
by
Winnie Hellmann
Committed by
Paul Slaughter
Jul 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate markdown header_spec.js to Jest
parent
d427c05f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
changelogs/unreleased/winh-jest-markdown-header.yml
changelogs/unreleased/winh-jest-markdown-header.yml
+5
-0
spec/frontend/vue_shared/components/markdown/header_spec.js
spec/frontend/vue_shared/components/markdown/header_spec.js
+5
-9
No files found.
changelogs/unreleased/winh-jest-markdown-header.yml
0 → 100644
View file @
f5461d7b
---
title
:
Migrate markdown header_spec.js to Jest
merge_request
:
30228
author
:
Martin Hobert
type
:
other
spec/
javascripts
/vue_shared/components/markdown/header_spec.js
→
spec/
frontend
/vue_shared/components/markdown/header_spec.js
View file @
f5461d7b
...
...
@@ -53,7 +53,7 @@ describe('Markdown field header component', () => {
});
it
(
'
emits toggle markdown event when clicking preview
'
,
()
=>
{
spyOn
(
vm
,
'
$emit
'
);
jest
.
spyOn
(
vm
,
'
$emit
'
).
mockImplementation
(
);
vm
.
$el
.
querySelector
(
'
.js-preview-link
'
).
click
();
...
...
@@ -65,7 +65,7 @@ describe('Markdown field header component', () => {
});
it
(
'
does not emit toggle markdown event when triggered from another form
'
,
()
=>
{
spyOn
(
vm
,
'
$emit
'
);
jest
.
spyOn
(
vm
,
'
$emit
'
).
mockImplementation
(
);
$
(
document
).
triggerHandler
(
'
markdown-preview:show
'
,
[
$
(
...
...
@@ -76,17 +76,13 @@ describe('Markdown field header component', () => {
expect
(
vm
.
$emit
).
not
.
toHaveBeenCalled
();
});
it
(
'
blurs preview link after click
'
,
done
=>
{
it
(
'
blurs preview link after click
'
,
()
=>
{
const
link
=
vm
.
$el
.
querySelector
(
'
li:nth-child(2) button
'
);
spyOn
(
HTMLElement
.
prototype
,
'
blur
'
);
jest
.
spyOn
(
HTMLElement
.
prototype
,
'
blur
'
).
mockImplementation
(
);
link
.
click
();
setTimeout
(()
=>
{
expect
(
link
.
blur
).
toHaveBeenCalled
();
done
();
});
expect
(
link
.
blur
).
toHaveBeenCalled
();
});
it
(
'
renders markdown table template
'
,
()
=>
{
...
...
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