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
13dc5124
Commit
13dc5124
authored
Mar 09, 2021
by
pburdette
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use data test id
Let's move away from using a css class and use a actual testing selector.
parent
3c0902c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
16 deletions
+16
-16
app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue
...scripts/ci_variable_list/components/ci_variable_table.vue
+1
-1
spec/features/project_group_variables_spec.rb
spec/features/project_group_variables_spec.rb
+1
-1
spec/features/project_variables_spec.rb
spec/features/project_variables_spec.rb
+1
-1
spec/support/shared_examples/features/variable_list_shared_examples.rb
...shared_examples/features/variable_list_shared_examples.rb
+13
-13
No files found.
app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue
View file @
13dc5124
...
...
@@ -84,7 +84,7 @@ export default {
</
script
>
<
template
>
<div
class=
"ci-variable-table"
>
<div
class=
"ci-variable-table"
data-testid=
"ci-variable-table"
>
<gl-table
:fields=
"fields"
:items=
"variables"
...
...
spec/features/project_group_variables_spec.rb
View file @
13dc5124
...
...
@@ -57,7 +57,7 @@ RSpec.describe 'Project group variables', :js do
wait_for_requests
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
expect
(
find
(
'.js-ci-variable-row:nth-child(1) [data-label="Key"]'
).
text
).
to
eq
(
key1
)
end
end
...
...
spec/features/project_variables_spec.rb
View file @
13dc5124
...
...
@@ -32,7 +32,7 @@ RSpec.describe 'Project variables', :js do
wait_for_requests
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
expect
(
find
(
'.js-ci-variable-row:first-child [data-label="Environments"]'
).
text
).
to
eq
(
'review/*'
)
end
end
...
...
spec/support/shared_examples/features/variable_list_shared_examples.rb
View file @
13dc5124
...
...
@@ -2,7 +2,7 @@
RSpec
.
shared_examples
'variable list'
do
it
'shows a list of variables'
do
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
expect
(
find
(
'.js-ci-variable-row:nth-child(1) td[data-label="Key"]'
).
text
).
to
eq
(
variable
.
key
)
end
end
...
...
@@ -16,7 +16,7 @@ RSpec.shared_examples 'variable list' do
wait_for_requests
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
expect
(
find
(
'.js-ci-variable-row:nth-child(1) td[data-label="Key"]'
).
text
).
to
eq
(
'key'
)
end
end
...
...
@@ -30,7 +30,7 @@ RSpec.shared_examples 'variable list' do
wait_for_requests
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
expect
(
find
(
'.js-ci-variable-row:nth-child(1) td[data-label="Key"]'
).
text
).
to
eq
(
'key'
)
expect
(
find
(
'.js-ci-variable-row:nth-child(1) td[data-label="Protected"] svg[data-testid="mobile-issue-close-icon"]'
)).
to
be_present
end
...
...
@@ -45,14 +45,14 @@ RSpec.shared_examples 'variable list' do
wait_for_requests
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
expect
(
find
(
'.js-ci-variable-row:nth-child(1) td[data-label="Key"]'
).
text
).
to
eq
(
'key'
)
expect
(
find
(
'.js-ci-variable-row:nth-child(1) td[data-label="Masked"] svg[data-testid="close-icon"]'
)).
to
be_present
end
end
it
'reveals and hides variables'
do
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
expect
(
first
(
'.js-ci-variable-row td[data-label="Key"]'
).
text
).
to
eq
(
variable
.
key
)
expect
(
page
).
to
have_content
(
'*'
*
17
)
...
...
@@ -72,7 +72,7 @@ RSpec.shared_examples 'variable list' do
it
'deletes a variable'
do
expect
(
page
).
to
have_selector
(
'.js-ci-variable-row'
,
count:
1
)
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
click_button
(
'Edit'
)
end
...
...
@@ -86,7 +86,7 @@ RSpec.shared_examples 'variable list' do
end
it
'edits a variable'
do
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
click_button
(
'Edit'
)
end
...
...
@@ -102,7 +102,7 @@ RSpec.shared_examples 'variable list' do
end
it
'edits a variable to be unmasked'
do
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
click_button
(
'Edit'
)
end
...
...
@@ -115,13 +115,13 @@ RSpec.shared_examples 'variable list' do
wait_for_requests
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
expect
(
find
(
'.js-ci-variable-row:nth-child(1) td[data-label="Masked"] svg[data-testid="close-icon"]'
)).
to
be_present
end
end
it
'edits a variable to be masked'
do
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
click_button
(
'Edit'
)
end
...
...
@@ -133,7 +133,7 @@ RSpec.shared_examples 'variable list' do
wait_for_requests
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
click_button
(
'Edit'
)
end
...
...
@@ -143,7 +143,7 @@ RSpec.shared_examples 'variable list' do
click_button
(
'Update variable'
)
end
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
expect
(
find
(
'.js-ci-variable-row:nth-child(1) td[data-label="Masked"] svg[data-testid="mobile-issue-close-icon"]'
)).
to
be_present
end
end
...
...
@@ -211,7 +211,7 @@ RSpec.shared_examples 'variable list' do
expect
(
page
).
to
have_selector
(
'.js-ci-variable-row'
,
count:
3
)
# Remove the `akey` variable
page
.
within
(
'
.ci-variable-table
'
)
do
page
.
within
(
'
[data-testid="ci-variable-table"]
'
)
do
page
.
within
(
'.js-ci-variable-row:first-child'
)
do
click_button
(
'Edit'
)
end
...
...
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