diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/features/incidents/incident_timeline_events_spec.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/features/incidents/incident_timeline_events_spec.rb')
-rw-r--r-- | spec/features/incidents/incident_timeline_events_spec.rb | 58 |
1 files changed, 45 insertions, 13 deletions
diff --git a/spec/features/incidents/incident_timeline_events_spec.rb b/spec/features/incidents/incident_timeline_events_spec.rb index e39f348013c..6db9f87d6f2 100644 --- a/spec/features/incidents/incident_timeline_events_spec.rb +++ b/spec/features/incidents/incident_timeline_events_spec.rb @@ -17,20 +17,20 @@ RSpec.describe 'Incident timeline events', :js do visit project_issues_incident_path(project, incident) wait_for_requests - click_link 'Timeline' + click_link s_('Incident|Timeline') end context 'when add event is clicked' do it 'submits event data when save is clicked' do - click_button 'Add new timeline event' + click_button s_('Incident|Add new timeline event') expect(page).to have_selector('.common-note-form') - fill_in 'Description', with: 'Event note goes here' + fill_in _('Description'), with: 'Event note goes here' fill_in 'timeline-input-hours', with: '07' fill_in 'timeline-input-minutes', with: '25' - click_button 'Save' + click_button _('Save') expect(page).to have_selector('.incident-timeline-events') @@ -41,30 +41,62 @@ RSpec.describe 'Incident timeline events', :js do end end - context 'when delete event is clicked' do + context 'when edit is clicked' do before do click_button 'Add new timeline event' - fill_in 'Description', with: 'Event note to delete' - click_button 'Save' + fill_in 'Description', with: 'Event note to edit' + click_button _('Save') + end + + it 'shows the confirmation modal and edits the event' do + click_button _('More actions') + + page.within '.gl-new-dropdown-contents' do + expect(page).to have_content(_('Edit')) + page.find('.gl-new-dropdown-item-text-primary', text: _('Edit')).click + end + + expect(page).to have_selector('.common-note-form') + + fill_in _('Description'), with: 'Event note goes here' + fill_in 'timeline-input-hours', with: '07' + fill_in 'timeline-input-minutes', with: '25' + + click_button _('Save') + + wait_for_requests + + page.within '.timeline-event-note' do + expect(page).to have_content('Event note goes here') + expect(page).to have_content('07:25') + end + end + end + + context 'when delete is clicked' do + before do + click_button s_('Incident|Add new timeline event') + fill_in _('Description'), with: 'Event note to delete' + click_button _('Save') end it 'shows the confirmation modal and deletes the event' do - click_button 'More actions' + click_button _('More actions') - page.within '.gl-new-dropdown-item-text-wrapper' do - expect(page).to have_content('Delete') + page.within '.gl-new-dropdown-contents' do + expect(page).to have_content(_('Delete')) page.find('.gl-new-dropdown-item-text-primary', text: 'Delete').click end page.within '.modal' do - expect(page).to have_content('Delete event') + expect(page).to have_content(s_('Incident|Delete event')) end - click_button 'Delete event' + click_button s_('Incident|Delete event') wait_for_requests - expect(page).to have_content('No timeline items have been added yet.') + expect(page).to have_content(s_('Incident|No timeline items have been added yet.')) end end end |