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
e161c7ca
Commit
e161c7ca
authored
Jan 08, 2020
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove incorrect localVue usage
localVue is required only with use method
parent
4372a6c9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
26 deletions
+19
-26
spec/frontend/vue_shared/components/gl_modal_vuex_spec.js
spec/frontend/vue_shared/components/gl_modal_vuex_spec.js
+5
-5
spec/frontend/vue_shared/components/markdown/field_spec.js
spec/frontend/vue_shared/components/markdown/field_spec.js
+11
-12
spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js
...ue_shared/components/markdown/suggestion_diff_row_spec.js
+1
-4
spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js
...ue_shared/components/user_avatar/user_avatar_list_spec.js
+2
-5
No files found.
spec/frontend/vue_shared/components/gl_modal_vuex_spec.js
View file @
e161c7ca
...
@@ -33,7 +33,7 @@ describe('GlModalVuex', () => {
...
@@ -33,7 +33,7 @@ describe('GlModalVuex', () => {
...
options
.
propsData
,
...
options
.
propsData
,
};
};
wrapper
=
shallowMount
(
localVue
.
extend
(
GlModalVuex
)
,
{
wrapper
=
shallowMount
(
GlModalVuex
,
{
...
options
,
...
options
,
localVue
,
localVue
,
store
,
store
,
...
@@ -123,8 +123,8 @@ describe('GlModalVuex', () => {
...
@@ -123,8 +123,8 @@ describe('GlModalVuex', () => {
state
.
isVisible
=
true
;
state
.
isVisible
=
true
;
localVue
wrapper
.
vm
.
nextTick
()
.
$
nextTick
()
.
then
(()
=>
{
.
then
(()
=>
{
expect
(
rootEmit
).
toHaveBeenCalledWith
(
'
bv::show::modal
'
,
TEST_MODAL_ID
);
expect
(
rootEmit
).
toHaveBeenCalledWith
(
'
bv::show::modal
'
,
TEST_MODAL_ID
);
})
})
...
@@ -140,8 +140,8 @@ describe('GlModalVuex', () => {
...
@@ -140,8 +140,8 @@ describe('GlModalVuex', () => {
state
.
isVisible
=
false
;
state
.
isVisible
=
false
;
localVue
wrapper
.
vm
.
nextTick
()
.
$
nextTick
()
.
then
(()
=>
{
.
then
(()
=>
{
expect
(
rootEmit
).
toHaveBeenCalledWith
(
'
bv::hide::modal
'
,
TEST_MODAL_ID
);
expect
(
rootEmit
).
toHaveBeenCalledWith
(
'
bv::hide::modal
'
,
TEST_MODAL_ID
);
})
})
...
...
spec/frontend/vue_shared/components/markdown/field_spec.js
View file @
e161c7ca
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
fieldComponent
from
'
~/vue_shared/components/markdown/field.vue
'
;
import
fieldComponent
from
'
~/vue_shared/components/markdown/field.vue
'
;
import
{
TEST_HOST
,
FIXTURES_PATH
}
from
'
spec/test_constants
'
;
import
{
TEST_HOST
,
FIXTURES_PATH
}
from
'
spec/test_constants
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
...
@@ -50,7 +50,6 @@ const getVideo = wrapper => wrapper.find('video');
...
@@ -50,7 +50,6 @@ const getVideo = wrapper => wrapper.find('video');
describe
(
'
Markdown field component
'
,
()
=>
{
describe
(
'
Markdown field component
'
,
()
=>
{
let
axiosMock
;
let
axiosMock
;
const
localVue
=
createLocalVue
();
beforeEach
(()
=>
{
beforeEach
(()
=>
{
axiosMock
=
new
AxiosMockAdapter
(
axios
);
axiosMock
=
new
AxiosMockAdapter
(
axios
);
...
@@ -84,7 +83,7 @@ describe('Markdown field component', () => {
...
@@ -84,7 +83,7 @@ describe('Markdown field component', () => {
previewLink
=
getPreviewLink
(
wrapper
);
previewLink
=
getPreviewLink
(
wrapper
);
previewLink
.
trigger
(
'
click
'
);
previewLink
.
trigger
(
'
click
'
);
return
localVue
.
nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$
nextTick
().
then
(()
=>
{
expect
(
previewLink
.
element
.
parentNode
.
classList
.
contains
(
'
active
'
)).
toBeTruthy
();
expect
(
previewLink
.
element
.
parentNode
.
classList
.
contains
(
'
active
'
)).
toBeTruthy
();
});
});
});
});
...
@@ -94,7 +93,7 @@ describe('Markdown field component', () => {
...
@@ -94,7 +93,7 @@ describe('Markdown field component', () => {
previewLink
=
getPreviewLink
(
wrapper
);
previewLink
=
getPreviewLink
(
wrapper
);
previewLink
.
trigger
(
'
click
'
);
previewLink
.
trigger
(
'
click
'
);
localVue
.
nextTick
(()
=>
{
wrapper
.
vm
.
$
nextTick
(()
=>
{
expect
(
wrapper
.
find
(
'
.md-preview-holder
'
).
element
.
textContent
.
trim
()).
toContain
(
expect
(
wrapper
.
find
(
'
.md-preview-holder
'
).
element
.
textContent
.
trim
()).
toContain
(
'
Loading…
'
,
'
Loading…
'
,
);
);
...
@@ -155,17 +154,17 @@ describe('Markdown field component', () => {
...
@@ -155,17 +154,17 @@ describe('Markdown field component', () => {
previewLink
=
getPreviewLink
(
wrapper
);
previewLink
=
getPreviewLink
(
wrapper
);
writeLink
.
trigger
(
'
click
'
);
writeLink
.
trigger
(
'
click
'
);
return
localVue
return
wrapper
.
vm
.
nextTick
()
.
$
nextTick
()
.
then
(()
=>
assertMarkdownTabs
(
true
,
writeLink
,
previewLink
,
wrapper
))
.
then
(()
=>
assertMarkdownTabs
(
true
,
writeLink
,
previewLink
,
wrapper
))
.
then
(()
=>
writeLink
.
trigger
(
'
click
'
))
.
then
(()
=>
writeLink
.
trigger
(
'
click
'
))
.
then
(()
=>
localVue
.
nextTick
())
.
then
(()
=>
wrapper
.
vm
.
$
nextTick
())
.
then
(()
=>
assertMarkdownTabs
(
true
,
writeLink
,
previewLink
,
wrapper
))
.
then
(()
=>
assertMarkdownTabs
(
true
,
writeLink
,
previewLink
,
wrapper
))
.
then
(()
=>
previewLink
.
trigger
(
'
click
'
))
.
then
(()
=>
previewLink
.
trigger
(
'
click
'
))
.
then
(()
=>
localVue
.
nextTick
())
.
then
(()
=>
wrapper
.
vm
.
$
nextTick
())
.
then
(()
=>
assertMarkdownTabs
(
false
,
writeLink
,
previewLink
,
wrapper
))
.
then
(()
=>
assertMarkdownTabs
(
false
,
writeLink
,
previewLink
,
wrapper
))
.
then
(()
=>
previewLink
.
trigger
(
'
click
'
))
.
then
(()
=>
previewLink
.
trigger
(
'
click
'
))
.
then
(()
=>
localVue
.
nextTick
())
.
then
(()
=>
wrapper
.
vm
.
$
nextTick
())
.
then
(()
=>
assertMarkdownTabs
(
false
,
writeLink
,
previewLink
,
wrapper
));
.
then
(()
=>
assertMarkdownTabs
(
false
,
writeLink
,
previewLink
,
wrapper
));
});
});
});
});
...
@@ -178,7 +177,7 @@ describe('Markdown field component', () => {
...
@@ -178,7 +177,7 @@ describe('Markdown field component', () => {
const
markdownButton
=
getMarkdownButton
(
wrapper
);
const
markdownButton
=
getMarkdownButton
(
wrapper
);
markdownButton
.
trigger
(
'
click
'
);
markdownButton
.
trigger
(
'
click
'
);
localVue
.
nextTick
(()
=>
{
wrapper
.
vm
.
$
nextTick
(()
=>
{
expect
(
textarea
.
value
).
toContain
(
'
**testing**
'
);
expect
(
textarea
.
value
).
toContain
(
'
**testing**
'
);
});
});
});
});
...
@@ -190,7 +189,7 @@ describe('Markdown field component', () => {
...
@@ -190,7 +189,7 @@ describe('Markdown field component', () => {
const
markdownButton
=
getAllMarkdownButtons
(
wrapper
).
wrappers
[
5
];
const
markdownButton
=
getAllMarkdownButtons
(
wrapper
).
wrappers
[
5
];
markdownButton
.
trigger
(
'
click
'
);
markdownButton
.
trigger
(
'
click
'
);
localVue
.
nextTick
(()
=>
{
wrapper
.
vm
.
$
nextTick
(()
=>
{
expect
(
textarea
.
value
).
toContain
(
'
* testing
'
);
expect
(
textarea
.
value
).
toContain
(
'
* testing
'
);
});
});
});
});
...
@@ -202,7 +201,7 @@ describe('Markdown field component', () => {
...
@@ -202,7 +201,7 @@ describe('Markdown field component', () => {
const
markdownButton
=
getAllMarkdownButtons
(
wrapper
).
wrappers
[
5
];
const
markdownButton
=
getAllMarkdownButtons
(
wrapper
).
wrappers
[
5
];
markdownButton
.
trigger
(
'
click
'
);
markdownButton
.
trigger
(
'
click
'
);
localVue
.
nextTick
(()
=>
{
wrapper
.
vm
.
$
nextTick
(()
=>
{
expect
(
textarea
.
value
).
toContain
(
'
* testing
\n
* 123
'
);
expect
(
textarea
.
value
).
toContain
(
'
* testing
\n
* 123
'
);
});
});
});
});
...
...
spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js
View file @
e161c7ca
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
SuggestionDiffRow
from
'
~/vue_shared/components/markdown/suggestion_diff_row.vue
'
;
import
SuggestionDiffRow
from
'
~/vue_shared/components/markdown/suggestion_diff_row.vue
'
;
const
oldLine
=
{
const
oldLine
=
{
...
@@ -27,10 +27,7 @@ describe('SuggestionDiffRow', () => {
...
@@ -27,10 +27,7 @@ describe('SuggestionDiffRow', () => {
let
wrapper
;
let
wrapper
;
const
factory
=
(
options
=
{})
=>
{
const
factory
=
(
options
=
{})
=>
{
const
localVue
=
createLocalVue
();
wrapper
=
shallowMount
(
SuggestionDiffRow
,
{
wrapper
=
shallowMount
(
SuggestionDiffRow
,
{
localVue
,
...
options
,
...
options
,
});
});
};
};
...
...
spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js
View file @
e161c7ca
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
...
@@ -20,8 +20,6 @@ const createList = n =>
...
@@ -20,8 +20,6 @@ const createList = n =>
.
fill
(
1
)
.
fill
(
1
)
.
map
((
x
,
id
)
=>
createUser
(
id
));
.
map
((
x
,
id
)
=>
createUser
(
id
));
const
localVue
=
createLocalVue
();
describe
(
'
UserAvatarList
'
,
()
=>
{
describe
(
'
UserAvatarList
'
,
()
=>
{
let
props
;
let
props
;
let
wrapper
;
let
wrapper
;
...
@@ -32,9 +30,8 @@ describe('UserAvatarList', () => {
...
@@ -32,9 +30,8 @@ describe('UserAvatarList', () => {
...
options
.
propsData
,
...
options
.
propsData
,
};
};
wrapper
=
shallowMount
(
localVue
.
extend
(
UserAvatarList
)
,
{
wrapper
=
shallowMount
(
UserAvatarList
,
{
...
options
,
...
options
,
localVue
,
propsData
,
propsData
,
});
});
};
};
...
...
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