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
Tatuya Kamada
gitlab-ce
Commits
1fa55069
Commit
1fa55069
authored
Nov 24, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for hiding variables and remove the need for ES6 Symbol
parent
a43f71ec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
app/assets/javascripts/project_variables.js.es6
app/assets/javascripts/project_variables.js.es6
+3
-3
spec/features/variables_spec.rb
spec/features/variables_spec.rb
+25
-0
No files found.
app/assets/javascripts/project_variables.js.es6
View file @
1fa55069
...
@@ -23,9 +23,9 @@
...
@@ -23,9 +23,9 @@
$btn.attr('data-status', newStatus);
$btn.attr('data-status', newStatus);
$variables = $('.variable-value');
let
$variables = $('.variable-value');
for (let variable of $variables
) {
$variables.each(function (_, variable
) {
let $variable = $(variable);
let $variable = $(variable);
let newText = HIDDEN_VALUE_TEXT;
let newText = HIDDEN_VALUE_TEXT;
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
}
}
$variable.text(newText);
$variable.text(newText);
}
}
);
$btn.text(newAction);
$btn.text(newAction);
}
}
...
...
spec/features/variables_spec.rb
View file @
1fa55069
...
@@ -29,6 +29,31 @@ describe 'Project variables', js: true do
...
@@ -29,6 +29,31 @@ describe 'Project variables', js: true do
end
end
end
end
it
'reveals and hides new variable'
do
fill_in
(
'variable_key'
,
with:
'key'
)
fill_in
(
'variable_value'
,
with:
'key value'
)
click_button
(
'Add new variable'
)
page
.
within
(
'.variables-table'
)
do
expect
(
page
).
to
have_content
(
'key'
)
expect
(
page
).
to
have_content
(
'******'
)
end
click_button
(
'Reveal Values'
)
page
.
within
(
'.variables-table'
)
do
expect
(
page
).
to
have_content
(
'key'
)
expect
(
page
).
to
have_content
(
'key value'
)
end
click_button
(
'Hide Values'
)
page
.
within
(
'.variables-table'
)
do
expect
(
page
).
to
have_content
(
'key'
)
expect
(
page
).
to
have_content
(
'******'
)
end
end
it
'deletes variable'
do
it
'deletes variable'
do
page
.
within
(
'.variables-table'
)
do
page
.
within
(
'.variables-table'
)
do
find
(
'.btn-variable-delete'
).
click
find
(
'.btn-variable-delete'
).
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