Commit 0f50c588 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Updated selectors for custom vsa feature spec

Update gettext file and fix some
minor linting issues
parent 488bf8d9
...@@ -9,7 +9,6 @@ import { ...@@ -9,7 +9,6 @@ import {
GlSprintf, GlSprintf,
GlButton, GlButton,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { s__ } from '~/locale';
import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils'; import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
import CustomStageFormFields from './create_value_stream_form/custom_stage_fields.vue'; import CustomStageFormFields from './create_value_stream_form/custom_stage_fields.vue';
import { validateFields, initializeFormData } from './create_value_stream_form/utils'; import { validateFields, initializeFormData } from './create_value_stream_form/utils';
......
...@@ -32,7 +32,7 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do ...@@ -32,7 +32,7 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do
start_event_identifier = :merge_request_created start_event_identifier = :merge_request_created
end_event_identifier = :merge_request_merged end_event_identifier = :merge_request_merged
start_label_event = :issue_label_added start_label_event = :issue_label_added
stop_label_event = :issue_label_removed end_label_event = :issue_label_removed
let(:add_stage_button) { '.js-add-stage-button' } let(:add_stage_button) { '.js-add-stage-button' }
let(:params) { { name: custom_stage_name, start_event_identifier: start_event_identifier, end_event_identifier: end_event_identifier } } let(:params) { { name: custom_stage_name, start_event_identifier: start_event_identifier, end_event_identifier: end_event_identifier } }
...@@ -57,11 +57,11 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do ...@@ -57,11 +57,11 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do
end end
def select_dropdown_option(name, value = start_event_identifier) def select_dropdown_option(name, value = start_event_identifier)
page.find("select[name='#{name}']").all('option').find { |item| item.value == value.to_s }.select_option page.find("[data-testid='#{name}'] select").all('option').find { |item| item.value == value.to_s }.select_option
end end
def select_dropdown_option_by_value(name, value, elem = 'option') def select_dropdown_option_by_value(name, value, elem = 'option')
page.find("select[name='#{name}']").find("#{elem}[value=#{value}]").select_option page.find("[data-testid='#{name}'] select").find("#{elem}[value=#{value}]").select_option
end end
def wait_for_labels(field) def wait_for_labels(field)
...@@ -212,17 +212,16 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do ...@@ -212,17 +212,16 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do
before do before do
fill_in 'custom-stage-name', with: custom_stage_name fill_in 'custom-stage-name', with: custom_stage_name
select_dropdown_option 'custom-stage-start-event', start_event_identifier select_dropdown_option 'custom-stage-start-event', start_event_identifier
select_dropdown_option 'custom-stage-stop-event', end_event_identifier select_dropdown_option 'custom-stage-end-event', end_event_identifier
end end
it 'does not have label dropdowns' do it 'does not have label dropdowns' do
expect(page).not_to have_content(s_('CustomCycleAnalytics|Start event label')) expect(page).not_to have_content(s_('CustomCycleAnalytics|Start event label'))
expect(page).not_to have_content(s_('CustomCycleAnalytics|Stop event label')) expect(page).not_to have_content(s_('CustomCycleAnalytics|End event label'))
end end
it 'submit button is disabled if a default name is used' do it 'submit button is disabled if a default name is used' do
fill_in 'custom-stage-name', with: 'issue' fill_in 'custom-stage-name', with: 'issue'
click_button(s_('CustomCycleAnalytics|Add stage'))
expect(page).to have_button(s_('CustomCycleAnalytics|Add stage'), disabled: true) expect(page).to have_button(s_('CustomCycleAnalytics|Add stage'), disabled: true)
end end
...@@ -240,7 +239,7 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do ...@@ -240,7 +239,7 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do
before do before do
fill_in 'custom-stage-name', with: custom_stage_with_labels_name fill_in 'custom-stage-name', with: custom_stage_with_labels_name
select_dropdown_option_by_value 'custom-stage-start-event', start_label_event select_dropdown_option_by_value 'custom-stage-start-event', start_label_event
select_dropdown_option_by_value 'custom-stage-stop-event', stop_label_event select_dropdown_option_by_value 'custom-stage-end-event', end_label_event
end end
it 'submit button is disabled' do it 'submit button is disabled' do
...@@ -249,11 +248,11 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do ...@@ -249,11 +248,11 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do
context 'with labels available' do context 'with labels available' do
start_field = 'custom-stage-start-event-label' start_field = 'custom-stage-start-event-label'
end_field = 'custom-stage-stop-event-label' end_field = 'custom-stage-end-event-label'
it 'does not contain labels from outside the group' do it 'does not contain labels from outside the group' do
wait_for_labels(start_field) wait_for_labels(start_field)
menu = page.find("[name=#{start_field}] .dropdown-menu") menu = page.find("[data-testid=#{start_field}] .dropdown-menu")
expect(menu).not_to have_content(other_label.name) expect(menu).not_to have_content(other_label.name)
expect(menu).to have_content(first_label.name) expect(menu).to have_content(first_label.name)
...@@ -282,7 +281,7 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do ...@@ -282,7 +281,7 @@ RSpec.describe 'Customizable Group Value Stream Analytics', :js do
let(:stage_save_button) { '[data-testid="save-custom-stage"]' } let(:stage_save_button) { '[data-testid="save-custom-stage"]' }
let(:name_field) { 'custom-stage-name' } let(:name_field) { 'custom-stage-name' }
let(:start_event_field) { 'custom-stage-start-event' } let(:start_event_field) { 'custom-stage-start-event' }
let(:end_event_field) { 'custom-stage-stop-event' } let(:end_event_field) { 'custom-stage-end-event' }
let(:updated_custom_stage_name) { 'Extra uber cool stage' } let(:updated_custom_stage_name) { 'Extra uber cool stage' }
before do before do
......
...@@ -2820,9 +2820,6 @@ msgstr "" ...@@ -2820,9 +2820,6 @@ msgstr ""
msgid "All changes are committed" msgid "All changes are committed"
msgstr "" msgstr ""
msgid "All default stages are currently visible"
msgstr ""
msgid "All email addresses will be used to identify your commits." msgid "All email addresses will be used to identify your commits."
msgstr "" msgstr ""
...@@ -8330,6 +8327,12 @@ msgstr "" ...@@ -8330,6 +8327,12 @@ msgstr ""
msgid "CustomCycleAnalytics|Add stage" msgid "CustomCycleAnalytics|Add stage"
msgstr "" msgstr ""
msgid "CustomCycleAnalytics|All default stages are currently visible"
msgstr ""
msgid "CustomCycleAnalytics|Default stages"
msgstr ""
msgid "CustomCycleAnalytics|Editing stage" msgid "CustomCycleAnalytics|Editing stage"
msgstr "" msgstr ""
...@@ -8351,13 +8354,13 @@ msgstr "" ...@@ -8351,13 +8354,13 @@ msgstr ""
msgid "CustomCycleAnalytics|Please select a start event first" msgid "CustomCycleAnalytics|Please select a start event first"
msgstr "" msgstr ""
msgid "CustomCycleAnalytics|Select end event" msgid "CustomCycleAnalytics|Recover hidden stage"
msgstr "" msgstr ""
msgid "CustomCycleAnalytics|Select start event" msgid "CustomCycleAnalytics|Select end event"
msgstr "" msgstr ""
msgid "CustomCycleAnalytics|Select stop event" msgid "CustomCycleAnalytics|Select start event"
msgstr "" msgstr ""
msgid "CustomCycleAnalytics|Stage name already exists" msgid "CustomCycleAnalytics|Stage name already exists"
...@@ -8372,9 +8375,6 @@ msgstr "" ...@@ -8372,9 +8375,6 @@ msgstr ""
msgid "CustomCycleAnalytics|Start event label" msgid "CustomCycleAnalytics|Start event label"
msgstr "" msgstr ""
msgid "CustomCycleAnalytics|Stop event label"
msgstr ""
msgid "CustomCycleAnalytics|Update stage" msgid "CustomCycleAnalytics|Update stage"
msgstr "" msgstr ""
...@@ -8959,9 +8959,6 @@ msgstr "" ...@@ -8959,9 +8959,6 @@ msgstr ""
msgid "Default projects limit" msgid "Default projects limit"
msgstr "" msgstr ""
msgid "Default stages"
msgstr ""
msgid "Default: Map a FogBugz account ID to a full name" msgid "Default: Map a FogBugz account ID to a full name"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment