diff options
Diffstat (limited to 'spec/features/issues/incident_issue_spec.rb')
-rw-r--r-- | spec/features/issues/incident_issue_spec.rb | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/spec/features/issues/incident_issue_spec.rb b/spec/features/issues/incident_issue_spec.rb index a2519a44604..d6ec7f1c539 100644 --- a/spec/features/issues/incident_issue_spec.rb +++ b/spec/features/issues/incident_issue_spec.rb @@ -26,6 +26,7 @@ RSpec.describe 'Incident Detail', :js do context 'when user displays the incident' do before do + stub_feature_flags(incident_timeline: project) project.add_developer(user) sign_in(user) @@ -72,6 +73,12 @@ RSpec.describe 'Incident Detail', :js do expect(hidden_items).to all(be_visible) end end + + it 'shows the edit title and description button' do + edit_button = find_all('[aria-label="Edit title and description"]') + + expect(edit_button).to all(be_visible) + end end context 'when on alert details tab' do @@ -87,6 +94,61 @@ RSpec.describe 'Incident Detail', :js do expect(hidden_items.count).to eq(0) end end + + it 'does not show the edit title and description button' do + edit_button = find_all('[aria-label="Edit title and description"]') + + expect(edit_button.count).to eq(0) + end + end + + context 'when on timeline events tab from incident route' do + before do + visit project_issues_incident_path(project, incident) + wait_for_requests + click_link 'Timeline' + end + + it 'does not show the linked issues and notes/comment components' do + page.within('.issuable-details') do + hidden_items = find_all('.js-issue-widgets') + + # Linked Issues/MRs and comment box are hidden on page + expect(hidden_items.count).to eq(0) + end + end + end + + context 'when on timeline events tab from issue route' do + before do + visit project_issue_path(project, incident) + wait_for_requests + click_link 'Timeline' + end + + it 'does not show the linked issues and notes/comment commponents' do + page.within('.issuable-details') do + hidden_items = find_all('.js-issue-widgets') + + # Linked Issues/MRs and comment box are hidden on page + expect(hidden_items.count).to eq(0) + end + end + end + + context 'when incident_timeline feature flag is disabled' do + before do + stub_feature_flags(incident_timeline: false) + + visit project_issue_path(project, incident) + wait_for_requests + end + + it 'does not show Timeline tab' do + tabs = find('[data-testid="incident-tabs"]') + + expect(tabs).not_to have_content('Timeline') + end end end end |