blob: 9ee3fe846a672088d09aa197b0e57f1068d3bc9f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Merge request > User sees revert modal', :js, :sidekiq_might_not_need_inline,
feature_category: :code_review_workflow do
include ContentEditorHelpers
let(:project) { create(:project, :public, :repository) }
let(:user) { project.creator }
let(:merge_request) { create(:merge_request, source_project: project) }
shared_examples 'showing the revert modal' do
it 'shows the revert modal' do
click_button('Revert')
page.within('[data-testid="modal-commit"]') do
expect(page).to have_content 'Revert this merge request'
end
end
end
before do
stub_feature_flags(unbatch_graphql_queries: false)
sign_in(user)
visit(project_merge_request_path(project, merge_request))
close_rich_text_promo_popover_if_present
page.within('.mr-state-widget') do
click_button 'Merge'
end
wait_for_requests
end
context 'without page reload after merge validates js correctly loaded' do
it_behaves_like 'showing the revert modal'
end
context 'with page reload validates js correctly loaded' do
before do
visit(merge_request_path(merge_request))
close_rich_text_promo_popover_if_present
end
it_behaves_like 'showing the revert modal'
end
end
|