Skip to content
Snippets Groups Projects
Commit 1fa55069 authored by Stan Hu's avatar Stan Hu
Browse files

Add spec for hiding variables and remove the need for ES6 Symbol

parent a43f71ec
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -23,9 +23,9 @@
 
$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 newText = HIDDEN_VALUE_TEXT;
 
Loading
Loading
@@ -34,7 +34,7 @@
}
 
$variable.text(newText);
}
});
 
$btn.text(newAction);
}
Loading
Loading
Loading
Loading
@@ -29,6 +29,31 @@ describe 'Project variables', js: true do
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
page.within('.variables-table') do
find('.btn-variable-delete').click
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment