diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/features/groups/empty_states_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/features/groups/empty_states_spec.rb')
-rw-r--r-- | spec/features/groups/empty_states_spec.rb | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/spec/features/groups/empty_states_spec.rb b/spec/features/groups/empty_states_spec.rb index aaa59108b95..4488f53a03f 100644 --- a/spec/features/groups/empty_states_spec.rb +++ b/spec/features/groups/empty_states_spec.rb @@ -7,8 +7,6 @@ RSpec.describe 'Group empty states' do let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user } before do - stub_feature_flags(vue_issuables_list: false) - sign_in(user) end @@ -34,42 +32,52 @@ RSpec.describe 'Group empty states' do expect(page).not_to have_selector('.empty-state') end - it "displays link to create new #{issuable} when no open #{issuable} is found" do + it "displays link to create new #{issuable} when no open #{issuable} is found", :js do create("closed_#{issuable}", project_relation => project) issuable_link_fn = "project_#{issuable}s_path" visit public_send(issuable_link_fn, project) + wait_for_all_requests + page.within(find('.empty-state')) do expect(page).to have_content(/There are no open #{issuable.to_s.humanize.downcase}/) - expect(page).to have_selector("#new_#{issuable}_body_link") + new_issuable_path = issuable == :issue ? 'new_project_issue_path' : 'project_new_merge_request_path' + + path = public_send(new_issuable_path, project) + + expect(page.find('a')['href']).to have_content(path) end end - it 'displays link to create new issue when the current search gave no results' do + it 'displays link to create new issue when the current search gave no results', :js do create(issuable, project_relation => project) issuable_link_fn = "project_#{issuable}s_path" visit public_send(issuable_link_fn, project, author_username: 'foo', scope: 'all', state: 'opened') + wait_for_all_requests + page.within(find('.empty-state')) do expect(page).to have_content(/Sorry, your filter produced no results/) new_issuable_path = issuable == :issue ? 'new_project_issue_path' : 'project_new_merge_request_path' path = public_send(new_issuable_path, project) - expect(page).to have_selector("#new_#{issuable}_body_link[href='#{path}']") + expect(page.find('a')['href']).to have_content(path) end end - it "displays conditional text when no closed #{issuable} is found" do + it "displays conditional text when no closed #{issuable} is found", :js do create(issuable, project_relation => project) issuable_link_fn = "project_#{issuable}s_path" visit public_send(issuable_link_fn, project, state: 'closed') + wait_for_all_requests + page.within(find('.empty-state')) do expect(page).to have_content(/There are no closed #{issuable.to_s.humanize.downcase}/) end |