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
84c531d7
Commit
84c531d7
authored
Jun 18, 2020
by
Himanshu Kapoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flaky spec in repo_editor_spec
parent
01e3ab93
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
spec/frontend/ide/components/repo_editor_spec.js
spec/frontend/ide/components/repo_editor_spec.js
+8
-9
No files found.
spec/frontend/ide/components/repo_editor_spec.js
View file @
84c531d7
...
...
@@ -557,6 +557,11 @@ describe('RepoEditor', () => {
});
});
// Pasting an image does a lot of things like using the FileReader API,
// so, waitForPromises isn't very reliable (and causes a flaky spec)
// Read more about state.watch: https://vuex.vuejs.org/api/#watch
const
waitForFileContentChange
=
()
=>
watchState
(
s
=>
s
.
entries
[
'
foo/bar.md
'
].
content
);
beforeEach
(()
=>
{
setFileName
(
'
bar.md
'
);
...
...
@@ -576,13 +581,10 @@ describe('RepoEditor', () => {
});
});
// The following test is flaky
// see https://gitlab.com/gitlab-org/gitlab/-/issues/221039
// eslint-disable-next-line jest/no-disabled-tests
it
.
skip
(
'
adds an image entry to the same folder for a pasted image in a markdown file
'
,
()
=>
{
it
(
'
adds an image entry to the same folder for a pasted image in a markdown file
'
,
()
=>
{
pasteImage
();
return
waitFor
Promises
().
then
(()
=>
{
return
waitFor
FileContentChange
().
then
(()
=>
{
expect
(
vm
.
$store
.
state
.
entries
[
'
foo/foo.png
'
]).
toMatchObject
({
path
:
'
foo/foo.png
'
,
type
:
'
blob
'
,
...
...
@@ -596,10 +598,7 @@ describe('RepoEditor', () => {
it
(
"
adds a markdown image tag to the file's contents
"
,
()
=>
{
pasteImage
();
// Pasting an image does a lot of things like using the FileReader API,
// so, waitForPromises isn't very reliable (and causes a flaky spec)
// Read more about state.watch: https://vuex.vuejs.org/api/#watch
return
watchState
(
s
=>
s
.
entries
[
'
foo/bar.md
'
].
content
).
then
(()
=>
{
return
waitForFileContentChange
().
then
(()
=>
{
expect
(
vm
.
file
.
content
).
toBe
(
'
hello world
\n
![foo.png](./foo.png)
'
);
});
});
...
...
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