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
341cfbae
Commit
341cfbae
authored
Dec 31, 2019
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix karma tests in future version of VTU
Fixes failing tests in @vue/test-utils 1.0.0-beta.30
parent
7213dc5f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
18 deletions
+27
-18
ee/spec/javascripts/approvals/components/mr_edit/mr_rules_hidden_inputs_spec.js
...provals/components/mr_edit/mr_rules_hidden_inputs_spec.js
+1
-1
ee/spec/javascripts/related_items_tree/components/tree_root_spec.js
...vascripts/related_items_tree/components/tree_root_spec.js
+2
-3
ee/spec/javascripts/roadmap/components/epics_list_section_spec.js
...javascripts/roadmap/components/epics_list_section_spec.js
+16
-9
spec/javascripts/diffs/components/app_spec.js
spec/javascripts/diffs/components/app_spec.js
+8
-5
No files found.
ee/spec/javascripts/approvals/components/mr_edit/mr_rules_hidden_inputs_spec.js
View file @
341cfbae
...
...
@@ -63,7 +63,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
it
(
'
is empty
'
,
()
=>
{
factory
();
expect
(
wrapper
.
html
()).
toBeUndefined
(
);
expect
(
wrapper
.
isEmpty
()).
toBe
(
true
);
});
});
...
...
ee/spec/javascripts/related_items_tree/components/tree_root_spec.js
View file @
341cfbae
...
...
@@ -50,7 +50,6 @@ const createComponent = ({
store
,
stubs
:
{
'
tree-item
'
:
true
,
'
gl-button
'
:
GlButton
,
},
propsData
:
{
parentItem
,
...
...
@@ -350,13 +349,13 @@ describe('RelatedItemsTree', () => {
});
it
(
'
renders `Show more` link
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
button
'
).
text
()).
toBe
(
'
Show more
'
);
expect
(
wrapper
.
find
(
GlButton
).
text
()).
toBe
(
'
Show more
'
);
});
it
(
'
calls `handleShowMoreClick` when `Show more` link is clicked
'
,
()
=>
{
spyOn
(
wrapper
.
vm
,
'
handleShowMoreClick
'
);
wrapper
.
find
(
'
button
'
).
trigger
(
'
click
'
);
wrapper
.
find
(
GlButton
).
vm
.
$emit
(
'
click
'
);
expect
(
wrapper
.
vm
.
handleShowMoreClick
).
toHaveBeenCalled
();
});
...
...
ee/spec/javascripts/roadmap/components/epics_list_section_spec.js
View file @
341cfbae
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
VirtualList
from
'
vue-virtual-scroll-list
'
;
import
epicsListSectionComponent
from
'
ee/roadmap/components/epics_list_section.vue
'
;
import
EpicItem
from
'
ee/roadmap/components/epic_item.vue
'
;
import
createStore
from
'
ee/roadmap/store
'
;
import
{
getTimeframeForMonthsView
}
from
'
ee/roadmap/utils/roadmap_utils
'
;
import
{
...
...
@@ -46,8 +47,8 @@ const createComponent = ({
localVue
,
store
,
stubs
:
{
'
epic-item
'
:
false
,
'
virtual-list
'
:
false
,
EpicItem
:
false
,
VirtualList
:
false
,
},
propsData
:
{
presetType
,
...
...
@@ -150,12 +151,15 @@ describe('EpicsListSectionComponent', () => {
});
describe
(
'
getEmptyRowContainerStyles
'
,
()
=>
{
it
(
'
returns empty object when there are no epics available to render
'
,
()
=>
{
it
(
'
returns empty object when there are no epics available to render
'
,
done
=>
{
wrapper
.
setProps
({
epics
:
[],
});
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
getEmptyRowContainerStyles
()).
toEqual
({});
done
();
});
});
it
(
'
returns object containing `height` when there epics available to render
'
,
()
=>
{
...
...
@@ -211,10 +215,13 @@ describe('EpicsListSectionComponent', () => {
expect
(
wrapper
.
vm
.
$el
.
classList
.
contains
(
'
epics-list-section
'
)).
toBe
(
true
);
});
it
(
'
renders virtual-list when roadmapBufferedRendering is `true` and `epics.length` is more than `bufferSize`
'
,
()
=>
{
it
(
'
renders virtual-list when roadmapBufferedRendering is `true` and `epics.length` is more than `bufferSize`
'
,
done
=>
{
wrapper
.
vm
.
setBufferSize
(
5
);
expect
(
wrapper
.
find
(
'
virtuallist-stub
'
).
exists
()).
toBe
(
true
);
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
find
(
VirtualList
).
exists
()).
toBe
(
true
);
done
();
});
});
it
(
'
renders epic-item when roadmapBufferedRendering is `false`
'
,
()
=>
{
...
...
@@ -222,7 +229,7 @@ describe('EpicsListSectionComponent', () => {
roadmapBufferedRendering
:
false
,
});
expect
(
wrapperFlagOff
.
find
(
'
epicitem-stub
'
).
exists
()).
toBe
(
true
);
expect
(
wrapperFlagOff
.
find
(
EpicItem
).
exists
()).
toBe
(
true
);
wrapperFlagOff
.
destroy
();
});
...
...
@@ -230,7 +237,7 @@ describe('EpicsListSectionComponent', () => {
it
(
'
renders epic-item when roadmapBufferedRendering is `true` and `epics.length` is less than `bufferSize`
'
,
()
=>
{
wrapper
.
vm
.
setBufferSize
(
50
);
expect
(
wrapper
.
find
(
'
epicitem-stub
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
EpicItem
).
exists
()).
toBe
(
true
);
});
it
(
'
renders empty row element when `epics.length` is less than `bufferSize`
'
,
()
=>
{
...
...
spec/javascripts/diffs/components/app_spec.js
View file @
341cfbae
...
...
@@ -68,7 +68,7 @@ describe('diffs/components/app', () => {
});
describe
(
'
fetch diff methods
'
,
()
=>
{
beforeEach
(
()
=>
{
beforeEach
(
done
=>
{
const
fetchResolver
=
()
=>
{
store
.
state
.
diffs
.
retrievingBatches
=
false
;
return
Promise
.
resolve
();
...
...
@@ -82,6 +82,7 @@ describe('diffs/components/app', () => {
spyOn
(
wrapper
.
vm
,
'
startRenderDiffsQueue
'
);
spyOn
(
wrapper
.
vm
,
'
unwatchDiscussions
'
);
store
.
state
.
diffs
.
retrievingBatches
=
true
;
wrapper
.
vm
.
$nextTick
(
done
);
});
it
(
'
calls fetchDiffFiles if diffsBatchLoad is not enabled
'
,
done
=>
{
...
...
@@ -99,30 +100,32 @@ describe('diffs/components/app', () => {
});
});
it
(
'
calls batch methods if diffsBatchLoad is enabled, and not latest version
'
,
()
=>
{
it
(
'
calls batch methods if diffsBatchLoad is enabled, and not latest version
'
,
done
=>
{
wrapper
.
vm
.
glFeatures
.
diffsBatchLoad
=
true
;
wrapper
.
vm
.
isLatestVersion
=
()
=>
false
;
wrapper
.
vm
.
fetchData
(
false
);
expect
(
wrapper
.
vm
.
fetchDiffFiles
).
not
.
toHaveBeenCalled
();
wrapper
.
vm
.
$nextTick
(()
=>
{
setTimeout
(()
=>
{
expect
(
wrapper
.
vm
.
startRenderDiffsQueue
).
toHaveBeenCalled
();
expect
(
wrapper
.
vm
.
fetchDiffFilesMeta
).
toHaveBeenCalled
();
expect
(
wrapper
.
vm
.
fetchDiffFilesBatch
).
toHaveBeenCalled
();
expect
(
wrapper
.
vm
.
unwatchDiscussions
).
toHaveBeenCalled
();
done
();
});
});
it
(
'
calls batch methods if diffsBatchLoad is enabled, and latest version
'
,
()
=>
{
it
(
'
calls batch methods if diffsBatchLoad is enabled, and latest version
'
,
done
=>
{
wrapper
.
vm
.
glFeatures
.
diffsBatchLoad
=
true
;
wrapper
.
vm
.
fetchData
(
false
);
expect
(
wrapper
.
vm
.
fetchDiffFiles
).
not
.
toHaveBeenCalled
();
wrapper
.
vm
.
$nextTick
(()
=>
{
setTimeout
(()
=>
{
expect
(
wrapper
.
vm
.
startRenderDiffsQueue
).
toHaveBeenCalled
();
expect
(
wrapper
.
vm
.
fetchDiffFilesMeta
).
toHaveBeenCalled
();
expect
(
wrapper
.
vm
.
fetchDiffFilesBatch
).
toHaveBeenCalled
();
expect
(
wrapper
.
vm
.
unwatchDiscussions
).
toHaveBeenCalled
();
done
();
});
});
});
...
...
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