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
e3277651
Commit
e3277651
authored
Apr 29, 2020
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove invalid test from field_spec
Closes
https://gitlab.com/gitlab-org/gitlab/-/issues/37249
parent
8714cdf0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
18 deletions
+14
-18
spec/frontend/vue_shared/components/markdown/field_spec.js
spec/frontend/vue_shared/components/markdown/field_spec.js
+14
-18
No files found.
spec/frontend/vue_shared/components/markdown/field_spec.js
View file @
e3277651
...
...
@@ -9,9 +9,9 @@ const markdownPreviewPath = `${TEST_HOST}/preview`;
const
markdownDocsPath
=
`
${
TEST_HOST
}
/docs`
;
function
assertMarkdownTabs
(
isWrite
,
writeLink
,
previewLink
,
wrapper
)
{
expect
(
writeLink
.
element
.
parentNode
.
classList
.
contains
(
'
active
'
)).
to
Equal
(
isWrite
);
expect
(
previewLink
.
element
.
parentNode
.
classList
.
contains
(
'
active
'
)).
to
Equal
(
!
isWrite
);
expect
(
wrapper
.
find
(
'
.md-preview-holder
'
).
element
.
style
.
display
).
to
Equal
(
isWrite
?
'
none
'
:
''
);
expect
(
writeLink
.
element
.
parentNode
.
classList
.
contains
(
'
active
'
)).
to
Be
(
isWrite
);
expect
(
previewLink
.
element
.
parentNode
.
classList
.
contains
(
'
active
'
)).
to
Be
(
!
isWrite
);
expect
(
wrapper
.
find
(
'
.md-preview-holder
'
).
element
.
style
.
display
).
to
Be
(
isWrite
?
'
none
'
:
''
);
}
function
createComponent
()
{
...
...
@@ -67,6 +67,10 @@ describe('Markdown field component', () => {
let
previewLink
;
let
writeLink
;
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
(
'
renders textarea inside backdrop
'
,
()
=>
{
wrapper
=
createComponent
();
expect
(
wrapper
.
find
(
'
.zen-backdrop textarea
'
).
element
).
not
.
toBeNull
();
...
...
@@ -92,32 +96,24 @@ describe('Markdown field component', () => {
previewLink
=
getPreviewLink
(
wrapper
);
previewLink
.
trigger
(
'
click
'
);
wrapper
.
vm
.
$nextTick
(()
=>
{
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
find
(
'
.md-preview-holder
'
).
element
.
textContent
.
trim
()).
toContain
(
'
Loading…
'
,
);
});
});
it
(
'
renders markdown preview
'
,
()
=>
{
it
(
'
renders markdown preview
and GFM
'
,
()
=>
{
wrapper
=
createComponent
();
previewLink
=
getPreviewLink
(
wrapper
);
previewLink
.
trigger
(
'
click
'
);
const
renderGFMSpy
=
jest
.
spyOn
(
$
.
fn
,
'
renderGFM
'
);
setTimeout
(()
=>
{
expect
(
wrapper
.
find
(
'
.md-preview-holder
'
).
element
.
innerHTML
).
toContain
(
previewHTML
);
});
});
it
(
'
renders GFM with jQuery
'
,
()
=>
{
wrapper
=
createComponent
();
previewLink
=
getPreviewLink
(
wrapper
);
jest
.
spyOn
(
$
.
fn
,
'
renderGFM
'
);
previewLink
.
trigger
(
'
click
'
);
return
axios
.
waitFor
(
markdownPreviewPath
).
then
(()
=>
{
expect
(
wrapper
.
find
(
'
.md-preview-holder
'
).
element
.
innerHTML
).
toContain
(
previewHTML
);
expect
(
renderGFMSpy
).
toHaveBeenCalled
();
});
});
...
...
@@ -176,7 +172,7 @@ describe('Markdown field component', () => {
const
markdownButton
=
getMarkdownButton
(
wrapper
);
markdownButton
.
trigger
(
'
click
'
);
wrapper
.
vm
.
$nextTick
(()
=>
{
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
textarea
.
value
).
toContain
(
'
**testing**
'
);
});
});
...
...
@@ -188,7 +184,7 @@ describe('Markdown field component', () => {
const
markdownButton
=
getAllMarkdownButtons
(
wrapper
).
wrappers
[
5
];
markdownButton
.
trigger
(
'
click
'
);
wrapper
.
vm
.
$nextTick
(()
=>
{
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
textarea
.
value
).
toContain
(
'
* testing
'
);
});
});
...
...
@@ -200,7 +196,7 @@ describe('Markdown field component', () => {
const
markdownButton
=
getAllMarkdownButtons
(
wrapper
).
wrappers
[
5
];
markdownButton
.
trigger
(
'
click
'
);
wrapper
.
vm
.
$nextTick
(()
=>
{
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
textarea
.
value
).
toContain
(
'
* testing
\n
* 123
'
);
});
});
...
...
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