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
Show 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';
...
@@ -3,25 +3,31 @@ import App from '~/issuable_suggestions/components/app.vue';
import
Suggestion
from
'
~/issuable_suggestions/components/item.vue
'
;
import
Suggestion
from
'
~/issuable_suggestions/components/item.vue
'
;
describe
(
'
Issuable suggestions app component
'
,
()
=>
{
describe
(
'
Issuable suggestions app component
'
,
()
=>
{
let
vm
;
let
wrapper
;
function
createComponent
(
search
=
'
search
'
)
{
function
createComponent
(
search
=
'
search
'
)
{
vm
=
shallowMount
(
App
,
{
wrapper
=
shallowMount
(
App
,
{
propsData
:
{
propsData
:
{
search
,
search
,
projectPath
:
'
project
'
,
projectPath
:
'
project
'
,
},
},
sync
:
false
,
attachToDocument
:
true
,
});
});
}
}
beforeEach
(()
=>
{
createComponent
();
});
afterEach
(()
=>
{
afterEach
(()
=>
{
vm
.
destroy
();
wrapper
.
destroy
();
});
});
it
(
'
does not render with empty search
'
,
()
=>
{
it
(
'
does not render with empty search
'
,
()
=>
{
createComponent
(
''
);
wrapper
.
setProps
({
search
:
''
}
);
expect
(
vm
.
isVisible
()).
toBe
(
false
);
expect
(
wrapper
.
isVisible
()).
toBe
(
false
);
});
});
describe
(
'
with data
'
,
()
=>
{
describe
(
'
with data
'
,
()
=>
{
...
@@ -32,65 +38,65 @@ describe('Issuable suggestions app component', () => {
...
@@ -32,65 +38,65 @@ describe('Issuable suggestions app component', () => {
});
});
it
(
'
renders component
'
,
()
=>
{
it
(
'
renders component
'
,
()
=>
{
createComponent
();
wrapper
.
setData
(
data
);
vm
.
setData
(
data
);
expect
(
vm
.
isEmpty
()).
toBe
(
false
);
expect
(
wrapper
.
isEmpty
()).
toBe
(
false
);
});
});
it
(
'
does not render with empty search
'
,
()
=>
{
it
(
'
does not render with empty search
'
,
()
=>
{
createComponent
(
''
);
wrapper
.
setProps
({
search
:
''
}
);
vm
.
setData
(
data
);
wrapper
.
setData
(
data
);
expect
(
vm
.
isVisible
()).
toBe
(
false
);
expect
(
wrapper
.
isVisible
()).
toBe
(
false
);
});
});
it
(
'
does not render when loading
'
,
()
=>
{
it
(
'
does not render when loading
'
,
()
=>
{
createComponent
();
wrapper
.
setData
({
vm
.
setData
({
...
data
,
...
data
,
loading
:
1
,
loading
:
1
,
});
});
expect
(
vm
.
isVisible
()).
toBe
(
false
);
expect
(
wrapper
.
isVisible
()).
toBe
(
false
);
});
});
it
(
'
does not render with empty issues data
'
,
()
=>
{
it
(
'
does not render with empty issues data
'
,
()
=>
{
createComponent
();
wrapper
.
setData
({
issues
:
[]
});
vm
.
setData
({
issues
:
[]
});
expect
(
vm
.
isVisible
()).
toBe
(
false
);
expect
(
wrapper
.
isVisible
()).
toBe
(
false
);
});
});
it
(
'
renders list of issues
'
,
()
=>
{
it
(
'
renders list of issues
'
,
()
=>
{
createComponent
();
wrapper
.
setData
(
data
);
vm
.
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
'
,
()
=>
{
it
(
'
adds margin class to first item
'
,
()
=>
{
createComponent
();
wrapper
.
setData
(
data
);
vm
.
setData
(
data
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
expect
(
vm
wrapper
.
findAll
(
'
li
'
)
.
findAll
(
'
li
'
)
.
at
(
0
)
.
at
(
0
)
.
is
(
'
.append-bottom-default
'
),
.
is
(
'
.append-bottom-default
'
),
).
toBe
(
true
);
).
toBe
(
true
);
});
});
});
it
(
'
does not add margin class to last item
'
,
()
=>
{
it
(
'
does not add margin class to last item
'
,
()
=>
{
createComponent
();
wrapper
.
setData
(
data
);
vm
.
setData
(
data
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
expect
(
vm
wrapper
.
findAll
(
'
li
'
)
.
findAll
(
'
li
'
)
.
at
(
1
)
.
at
(
1
)
.
is
(
'
.append-bottom-default
'
),
.
is
(
'
.append-bottom-default
'
),
).
toBe
(
false
);
).
toBe
(
false
);
});
});
});
});
});
});
});
spec/frontend/issuable_suggestions/components/item_spec.js
View file @
7ba0274c
...
@@ -16,6 +16,8 @@ describe('Issuable suggestions suggestion component', () => {
...
@@ -16,6 +16,8 @@ describe('Issuable suggestions suggestion component', () => {
...
suggestion
,
...
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