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
479c8216
Commit
479c8216
authored
Mar 19, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate cycle-analytics/banner_spec to VTU
parent
de555479
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
spec/frontend/cycle_analytics/banner_spec.js
spec/frontend/cycle_analytics/banner_spec.js
+24
-22
No files found.
spec/frontend/cycle_analytics/banner_spec.js
View file @
479c8216
import
Vue
from
'
vue
'
;
import
mountComponent
from
'
helpers/vue_mount_component_helper
'
;
import
banner
from
'
~/cycle_analytics/components/banner.vue
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Banner
from
'
~/cycle_analytics/components/banner.vue
'
;
describe
(
'
Value Stream Analytics banner
'
,
()
=>
{
let
vm
;
let
wrapper
;
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
banner
);
vm
=
mountComponent
(
Component
,
{
documentationLink
:
'
path
'
,
const
createComponent
=
()
=>
{
wrapper
=
shallowMount
(
Banner
,
{
propsData
:
{
documentationLink
:
'
path
'
,
},
});
};
beforeEach
(()
=>
{
createComponent
();
});
afterEach
(()
=>
{
vm
.
$
destroy
();
wrapper
.
destroy
();
});
it
(
'
should render value stream analytics information
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
h4
'
).
textContent
.
trim
()).
toEqual
(
'
Introducing Value Stream Analytics
'
,
);
expect
(
wrapper
.
find
(
'
h4
'
).
text
().
trim
()).
toBe
(
'
Introducing Value Stream Analytics
'
);
expect
(
vm
.
$el
.
querySelector
(
'
p
'
)
.
textContent
.
trim
()
wrapper
.
find
(
'
p
'
)
.
text
()
.
trim
()
.
replace
(
/
[\r\n]
+/g
,
'
'
),
).
toContain
(
'
Value Stream Analytics gives an overview of how much time it takes to go from idea to production in your project.
'
,
);
expect
(
vm
.
$el
.
querySelector
(
'
a
'
).
textContent
.
trim
()).
toEqual
(
'
Read more
'
);
expect
(
vm
.
$el
.
querySelector
(
'
a
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
path
'
);
expect
(
wrapper
.
find
(
'
a
'
).
text
().
trim
()).
toBe
(
'
Read more
'
);
expect
(
wrapper
.
find
(
'
a
'
).
attributes
(
'
href
'
)).
toBe
(
'
path
'
);
});
it
(
'
should emit an event when close button is clicked
'
,
()
=>
{
jest
.
spyOn
(
vm
,
'
$emit
'
).
mockImplementation
(()
=>
{});
it
(
'
should emit an event when close button is clicked
'
,
async
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
$emit
'
).
mockImplementation
(()
=>
{});
vm
.
$el
.
querySelector
(
'
.js-ca-dismiss-button
'
).
click
(
);
await
wrapper
.
find
(
'
.js-ca-dismiss-button
'
).
trigger
(
'
click
'
);
expect
(
vm
.
$emit
).
toHaveBeenCalled
();
expect
(
wrapper
.
vm
.
$emit
).
toHaveBeenCalled
();
});
});
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