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
fdc60ebf
Commit
fdc60ebf
authored
Nov 22, 2019
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make pipelines specs compatible w/ BootstrapVue 2
parent
cb759668
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
spec/frontend/pipelines/graph/action_component_spec.js
spec/frontend/pipelines/graph/action_component_spec.js
+1
-0
spec/frontend/pipelines/pipeline_triggerer_spec.js
spec/frontend/pipelines/pipeline_triggerer_spec.js
+17
-11
No files found.
spec/frontend/pipelines/graph/action_component_spec.js
View file @
fdc60ebf
...
...
@@ -20,6 +20,7 @@ describe('pipeline graph action component', () => {
actionIcon
:
'
cancel
'
,
},
sync
:
false
,
attachToDocument
:
true
,
});
});
...
...
spec/frontend/pipelines/pipeline_triggerer_spec.js
View file @
fdc60ebf
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
UserAvatarLink
from
'
~/vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
pipelineTriggerer
from
'
~/pipelines/components/pipeline_triggerer.vue
'
;
describe
(
'
Pipelines Triggerer
'
,
()
=>
{
let
wrapper
;
const
expectComponentWithProps
=
(
Component
,
props
=
{})
=>
{
const
componentWrapper
=
wrapper
.
find
(
Component
);
expect
(
componentWrapper
.
isVisible
()).
toBe
(
true
);
expect
(
componentWrapper
.
props
()).
toEqual
(
expect
.
objectContaining
(
props
));
};
const
mockData
=
{
pipeline
:
{
user
:
{
...
...
@@ -15,9 +22,10 @@ describe('Pipelines Triggerer', () => {
};
const
createComponent
=
()
=>
{
wrapper
=
m
ount
(
pipelineTriggerer
,
{
wrapper
=
shallowM
ount
(
pipelineTriggerer
,
{
propsData
:
mockData
,
sync
:
false
,
attachToDocument
:
true
,
});
};
...
...
@@ -33,14 +41,12 @@ describe('Pipelines Triggerer', () => {
expect
(
wrapper
.
contains
(
'
.table-section
'
)).
toBe
(
true
);
});
it
(
'
should render triggerer information when triggerer is provided
'
,
()
=>
{
const
link
=
wrapper
.
find
(
'
.js-pipeline-url-user
'
);
expect
(
link
.
attributes
(
'
href
'
)).
toEqual
(
mockData
.
pipeline
.
user
.
path
);
expect
(
link
.
find
(
'
.js-user-avatar-image-toolip
'
).
text
()).
toEqual
(
mockData
.
pipeline
.
user
.
name
);
expect
(
link
.
find
(
'
img.avatar
'
).
attributes
(
'
src
'
)).
toEqual
(
`
${
mockData
.
pipeline
.
user
.
avatar_url
}
?width=26`
,
);
it
(
'
should pass triggerer information when triggerer is provided
'
,
()
=>
{
expectComponentWithProps
(
UserAvatarLink
,
{
linkHref
:
mockData
.
pipeline
.
user
.
path
,
tooltipText
:
mockData
.
pipeline
.
user
.
name
,
imgSrc
:
mockData
.
pipeline
.
user
.
avatar_url
,
});
});
it
(
'
should render "API" when no triggerer is provided
'
,
()
=>
{
...
...
@@ -50,7 +56,7 @@ describe('Pipelines Triggerer', () => {
},
});
wrapper
.
vm
.
$nextTick
(()
=>
{
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
find
(
'
.js-pipeline-url-api
'
).
text
()).
toEqual
(
'
API
'
);
});
});
...
...
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