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
7ba0274c
Commit
7ba0274c
authored
Nov 30, 2019
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make issuable suggesstions specs compatible w/ BootstrapVue 2
parent
cb759668
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
38 deletions
+46
-38
spec/frontend/issuable_suggestions/components/app_spec.js
spec/frontend/issuable_suggestions/components/app_spec.js
+44
-38
spec/frontend/issuable_suggestions/components/item_spec.js
spec/frontend/issuable_suggestions/components/item_spec.js
+2
-0
No files found.
spec/frontend/issuable_suggestions/components/app_spec.js
View file @
7ba0274c
...
...
@@ -3,25 +3,31 @@ import App from '~/issuable_suggestions/components/app.vue';
import
Suggestion
from
'
~/issuable_suggestions/components/item.vue
'
;
describe
(
'
Issuable suggestions app component
'
,
()
=>
{
let
vm
;
let
wrapper
;
function
createComponent
(
search
=
'
search
'
)
{
vm
=
shallowMount
(
App
,
{
wrapper
=
shallowMount
(
App
,
{
propsData
:
{
search
,
projectPath
:
'
project
'
,
},
sync
:
false
,
attachToDocument
:
true
,
});
}
beforeEach
(()
=>
{
createComponent
();
});
afterEach
(()
=>
{
vm
.
destroy
();
wrapper
.
destroy
();
});
it
(
'
does not render with empty search
'
,
()
=>
{
createComponent
(
''
);
wrapper
.
setProps
({
search
:
''
}
);
expect
(
vm
.
isVisible
()).
toBe
(
false
);
expect
(
wrapper
.
isVisible
()).
toBe
(
false
);
});
describe
(
'
with data
'
,
()
=>
{
...
...
@@ -32,65 +38,65 @@ describe('Issuable suggestions app component', () => {
});
it
(
'
renders component
'
,
()
=>
{
createComponent
();
vm
.
setData
(
data
);
wrapper
.
setData
(
data
);
expect
(
vm
.
isEmpty
()).
toBe
(
false
);
expect
(
wrapper
.
isEmpty
()).
toBe
(
false
);
});
it
(
'
does not render with empty search
'
,
()
=>
{
createComponent
(
''
);
vm
.
setData
(
data
);
wrapper
.
setProps
({
search
:
''
}
);
wrapper
.
setData
(
data
);
expect
(
vm
.
isVisible
()).
toBe
(
false
);
expect
(
wrapper
.
isVisible
()).
toBe
(
false
);
});
it
(
'
does not render when loading
'
,
()
=>
{
createComponent
();
vm
.
setData
({
wrapper
.
setData
({
...
data
,
loading
:
1
,
});
expect
(
vm
.
isVisible
()).
toBe
(
false
);
expect
(
wrapper
.
isVisible
()).
toBe
(
false
);
});
it
(
'
does not render with empty issues data
'
,
()
=>
{
createComponent
();
vm
.
setData
({
issues
:
[]
});
wrapper
.
setData
({
issues
:
[]
});
expect
(
vm
.
isVisible
()).
toBe
(
false
);
expect
(
wrapper
.
isVisible
()).
toBe
(
false
);
});
it
(
'
renders list of issues
'
,
()
=>
{
createComponent
();
vm
.
setData
(
data
);
wrapper
.
setData
(
data
);
expect
(
vm
.
findAll
(
Suggestion
).
length
).
toBe
(
2
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
findAll
(
Suggestion
).
length
).
toBe
(
2
);
});
});
it
(
'
adds margin class to first item
'
,
()
=>
{
createComponent
();
vm
.
setData
(
data
);
expect
(
vm
.
findAll
(
'
li
'
)
.
at
(
0
)
.
is
(
'
.append-bottom-default
'
),
).
toBe
(
true
);
wrapper
.
setData
(
data
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
findAll
(
'
li
'
)
.
at
(
0
)
.
is
(
'
.append-bottom-default
'
),
).
toBe
(
true
);
});
});
it
(
'
does not add margin class to last item
'
,
()
=>
{
createComponent
();
vm
.
setData
(
data
);
expect
(
vm
.
findAll
(
'
li
'
)
.
at
(
1
)
.
is
(
'
.append-bottom-default
'
),
).
toBe
(
false
);
wrapper
.
setData
(
data
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
findAll
(
'
li
'
)
.
at
(
1
)
.
is
(
'
.append-bottom-default
'
),
).
toBe
(
false
);
});
});
});
});
spec/frontend/issuable_suggestions/components/item_spec.js
View file @
7ba0274c
...
...
@@ -16,6 +16,8 @@ describe('Issuable suggestions suggestion component', () => {
...
suggestion
,
},
},
sync
:
false
,
attachToDocument
:
true
,
});
}
...
...
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