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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
c796304e
Commit
c796304e
authored
Dec 15, 2017
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests for toggle design change
parent
b11c7912
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
spec/javascripts/vue_shared/components/toggle_button_spec.js
spec/javascripts/vue_shared/components/toggle_button_spec.js
+11
-3
No files found.
spec/javascripts/vue_shared/components/toggle_button_spec.js
View file @
c796304e
...
@@ -30,9 +30,9 @@ describe('Toggle Button', () => {
...
@@ -30,9 +30,9 @@ describe('Toggle Button', () => {
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
getAttribute
(
'
value
'
)).
toEqual
(
'
true
'
);
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
getAttribute
(
'
value
'
)).
toEqual
(
'
true
'
);
});
});
it
(
'
renders
Enabled and Disabled text data attributes
'
,
()
=>
{
it
(
'
renders
input status icon
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
button
'
).
getAttribute
(
'
data-enabled-text
'
)).
toEqual
(
'
Enabled
'
);
expect
(
vm
.
$el
.
querySelector
All
(
'
span.toggle-icon
'
).
length
).
toEqual
(
1
);
expect
(
vm
.
$el
.
querySelector
(
'
button
'
).
getAttribute
(
'
data-disabled-text
'
)).
toEqual
(
'
Disabled
'
);
expect
(
vm
.
$el
.
querySelector
All
(
'
svg.s16.toggle-icon-svg
'
).
length
).
toEqual
(
1
);
});
});
});
});
...
@@ -49,6 +49,14 @@ describe('Toggle Button', () => {
...
@@ -49,6 +49,14 @@ describe('Toggle Button', () => {
expect
(
vm
.
$el
.
querySelector
(
'
button
'
).
classList
.
contains
(
'
is-checked
'
)).
toEqual
(
true
);
expect
(
vm
.
$el
.
querySelector
(
'
button
'
).
classList
.
contains
(
'
is-checked
'
)).
toEqual
(
true
);
});
});
it
(
'
sets aria-label representing toggle state
'
,
()
=>
{
vm
.
value
=
true
;
expect
(
vm
.
ariaLabel
).
toEqual
(
'
Toggle Status: ON
'
);
vm
.
value
=
false
;
expect
(
vm
.
ariaLabel
).
toEqual
(
'
Toggle Status: OFF
'
);
});
it
(
'
emits change event when clicked
'
,
()
=>
{
it
(
'
emits change event when clicked
'
,
()
=>
{
vm
.
$el
.
querySelector
(
'
button
'
).
click
();
vm
.
$el
.
querySelector
(
'
button
'
).
click
();
...
...
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