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
c2f72ad8
Commit
c2f72ad8
authored
Dec 07, 2018
by
jhampton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds toggle behavior
- Adds coverage for hide/reveal toggle button behavior
parent
dab2fc92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
spec/javascripts/jobs/components/trigger_block_spec.js
spec/javascripts/jobs/components/trigger_block_spec.js
+21
-2
No files found.
spec/javascripts/jobs/components/trigger_block_spec.js
View file @
c2f72ad8
...
@@ -31,8 +31,8 @@ describe('Trigger block', () => {
...
@@ -31,8 +31,8 @@ describe('Trigger block', () => {
});
});
describe
(
'
with variables
'
,
()
=>
{
describe
(
'
with variables
'
,
()
=>
{
describe
(
'
reveal variables
'
,
()
=>
{
describe
(
'
hide/
reveal variables
'
,
()
=>
{
it
(
'
reveals
variables on click
'
,
done
=>
{
it
(
'
should toggle
variables on click
'
,
done
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
{
trigger
:
{
trigger
:
{
short_token
:
'
bd7e
'
,
short_token
:
'
bd7e
'
,
...
@@ -48,6 +48,9 @@ describe('Trigger block', () => {
...
@@ -48,6 +48,9 @@ describe('Trigger block', () => {
vm
.
$nextTick
()
vm
.
$nextTick
()
.
then
(()
=>
{
.
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-build-variables
'
)).
not
.
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-build-variables
'
)).
not
.
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-reveal-variables
'
).
textContent
.
trim
()).
toEqual
(
'
Hide values
'
,
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-build-variables
'
).
textContent
).
toContain
(
expect
(
vm
.
$el
.
querySelector
(
'
.js-build-variables
'
).
textContent
).
toContain
(
'
UPLOAD_TO_GCS
'
,
'
UPLOAD_TO_GCS
'
,
);
);
...
@@ -58,6 +61,22 @@ describe('Trigger block', () => {
...
@@ -58,6 +61,22 @@ describe('Trigger block', () => {
);
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-build-variables
'
).
textContent
).
toContain
(
'
true
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-build-variables
'
).
textContent
).
toContain
(
'
true
'
);
vm
.
$el
.
querySelector
(
'
.js-reveal-variables
'
).
click
();
})
.
then
(
vm
.
$nextTick
)
.
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-reveal-variables
'
).
textContent
.
trim
()).
toEqual
(
'
Reveal values
'
,
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-build-variables
'
).
textContent
).
toContain
(
'
UPLOAD_TO_GCS
'
,
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-build-value
'
).
textContent
).
toContain
(
'
••••••
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-build-variables
'
).
textContent
).
toContain
(
'
UPLOAD_TO_S3
'
,
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-build-value
'
).
textContent
).
toContain
(
'
••••••
'
);
})
})
.
then
(
done
)
.
then
(
done
)
.
catch
(
done
.
fail
);
.
catch
(
done
.
fail
);
...
...
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