diff options
author | Phil Hughes <me@iamphill.com> | 2017-08-17 09:51:19 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-08-29 15:35:49 +0100 |
commit | 4a67699e6e115aab3a26eee63f1f6ded4081ccd5 (patch) | |
tree | 406f0470a5562c57ee026e03f87f3579a0da7244 | |
parent | d0d918c765f42b25b0d64001a3784317d1da4f70 (diff) | |
download | gitlab-ce-4a67699e6e115aab3a26eee63f1f6ded4081ccd5.tar.gz |
spec updates
-rw-r--r-- | spec/features/boards/boards_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/dashboard/active_tab_spec.rb | 5 | ||||
-rw-r--r-- | spec/features/dashboard/issues_filter_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/groups/group_name_toggle_spec.rb | 51 | ||||
-rw-r--r-- | spec/features/groups/group_settings_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/issues_spec.rb | 40 | ||||
-rw-r--r-- | spec/features/projects/guest_navigation_menu_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/projects/project_settings_spec.rb | 14 | ||||
-rw-r--r-- | spec/features/projects/sub_group_issuables_spec.rb | 2 |
9 files changed, 41 insertions, 81 deletions
diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb index ce458431c55..6a8b16a3021 100644 --- a/spec/features/boards/boards_spec.rb +++ b/spec/features/boards/boards_spec.rb @@ -145,6 +145,8 @@ describe 'Issue Boards', js: true do click_button 'Add list' wait_for_requests + find('.dropdown-menu-close').click + page.within(find('.board:nth-child(2)')) do find('.board-delete').click end diff --git a/spec/features/dashboard/active_tab_spec.rb b/spec/features/dashboard/active_tab_spec.rb index 067e4337e6a..5a46675e59f 100644 --- a/spec/features/dashboard/active_tab_spec.rb +++ b/spec/features/dashboard/active_tab_spec.rb @@ -7,9 +7,8 @@ RSpec.describe 'Dashboard Active Tab', js: true do shared_examples 'page has active tab' do |title| it "#{title} tab" do - find('.global-dropdown-toggle').trigger('click') - expect(page).to have_selector('.global-dropdown-menu li.active', count: 1) - expect(find('.global-dropdown-menu li.active')).to have_content(title) + expect(page).to have_selector('.navbar-sub-nav li.active', count: 1) + expect(find('.navbar-sub-nav li.active')).to have_content(title) end end diff --git a/spec/features/dashboard/issues_filter_spec.rb b/spec/features/dashboard/issues_filter_spec.rb index facb67ae787..ebc3d196118 100644 --- a/spec/features/dashboard/issues_filter_spec.rb +++ b/spec/features/dashboard/issues_filter_spec.rb @@ -50,7 +50,7 @@ feature 'Dashboard Issues filtering', :js do it 'updates atom feed link' do visit_issues(milestone_title: '', assignee_id: user.id) - link = find('.nav-controls a[title="Subscribe"]') + link = find('.breadcrumbs a[title="Subscribe"]') params = CGI.parse(URI.parse(link[:href]).query) auto_discovery_link = find('link[type="application/atom+xml"]', visible: false) auto_discovery_params = CGI.parse(URI.parse(auto_discovery_link[:href]).query) diff --git a/spec/features/groups/group_name_toggle_spec.rb b/spec/features/groups/group_name_toggle_spec.rb deleted file mode 100644 index a7b8b702ab7..00000000000 --- a/spec/features/groups/group_name_toggle_spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -require 'spec_helper' - -feature 'Group name toggle', js: true do - let(:group) { create(:group) } - let(:nested_group_1) { create(:group, parent: group) } - let(:nested_group_2) { create(:group, parent: nested_group_1) } - let(:nested_group_3) { create(:group, parent: nested_group_2) } - - SMALL_SCREEN = 300 - - before do - sign_in(create(:user)) - end - - it 'is not present if enough horizontal space' do - visit group_path(nested_group_3) - - container_width = page.evaluate_script("$('.title-container')[0].offsetWidth") - title_width = page.evaluate_script("$('.title')[0].offsetWidth") - - expect(container_width).to be > title_width - expect(page).not_to have_css('.group-name-toggle') - end - - it 'is present if the title is longer than the container', :nested_groups do - visit group_path(nested_group_3) - title_width = page.evaluate_script("$('.title')[0].offsetWidth") - - page_height = page.current_window.size[1] - page.current_window.resize_to(SMALL_SCREEN, page_height) - - find('.group-name-toggle') - container_width = page.evaluate_script("$('.title-container')[0].offsetWidth") - - expect(title_width).to be > container_width - end - - it 'should show the full group namespace when toggled', :nested_groups do - page_height = page.current_window.size[1] - page.current_window.resize_to(SMALL_SCREEN, page_height) - visit group_path(nested_group_3) - - expect(page).not_to have_content(group.name) - expect(page).to have_css('.group-path.hidable', visible: false) - - click_button '...' - - expect(page).to have_content(group.name) - expect(page).to have_css('.group-path.hidable', visible: true) - end -end diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb index d0316cfb18d..b83bad3befb 100644 --- a/spec/features/groups/group_settings_spec.rb +++ b/spec/features/groups/group_settings_spec.rb @@ -65,14 +65,14 @@ feature 'Edit group settings' do update_path(new_group_path) visit new_project_full_path expect(current_path).to eq(new_project_full_path) - expect(find('h1.title')).to have_content(project.path) + expect(find('.breadcrumbs')).to have_content(project.path) end scenario 'the old project path redirects to the new path' do update_path(new_group_path) visit old_project_full_path expect(current_path).to eq(new_project_full_path) - expect(find('h1.title')).to have_content(project.path) + expect(find('.breadcrumbs')).to have_content(project.path) end end end diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index 3ffc80622f5..61f8bb3a35a 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -271,17 +271,21 @@ describe 'Issues' do it 'filters by none' do visit project_issues_path(project, due_date: Issue::NoDueDate.name) - expect(page).not_to have_content('foo') - expect(page).not_to have_content('bar') - expect(page).to have_content('baz') + page.within '.issues-holder' do + expect(page).not_to have_content('foo') + expect(page).not_to have_content('bar') + expect(page).to have_content('baz') + end end it 'filters by any' do visit project_issues_path(project, due_date: Issue::AnyDueDate.name) - expect(page).to have_content('foo') - expect(page).to have_content('bar') - expect(page).to have_content('baz') + page.within '.issues-holder' do + expect(page).to have_content('foo') + expect(page).to have_content('bar') + expect(page).to have_content('baz') + end end it 'filters by due this week' do @@ -291,9 +295,11 @@ describe 'Issues' do visit project_issues_path(project, due_date: Issue::DueThisWeek.name) - expect(page).to have_content('foo') - expect(page).to have_content('bar') - expect(page).not_to have_content('baz') + page.within '.issues-holder' do + expect(page).to have_content('foo') + expect(page).to have_content('bar') + expect(page).not_to have_content('baz') + end end it 'filters by due this month' do @@ -303,9 +309,11 @@ describe 'Issues' do visit project_issues_path(project, due_date: Issue::DueThisMonth.name) - expect(page).to have_content('foo') - expect(page).to have_content('bar') - expect(page).not_to have_content('baz') + page.within '.issues-holder' do + expect(page).to have_content('foo') + expect(page).to have_content('bar') + expect(page).not_to have_content('baz') + end end it 'filters by overdue' do @@ -315,9 +323,11 @@ describe 'Issues' do visit project_issues_path(project, due_date: Issue::Overdue.name) - expect(page).not_to have_content('foo') - expect(page).not_to have_content('bar') - expect(page).to have_content('baz') + page.within '.issues-holder' do + expect(page).not_to have_content('foo') + expect(page).not_to have_content('bar') + expect(page).to have_content('baz') + end end end diff --git a/spec/features/projects/guest_navigation_menu_spec.rb b/spec/features/projects/guest_navigation_menu_spec.rb index 2385e1d9333..97635d67fea 100644 --- a/spec/features/projects/guest_navigation_menu_spec.rb +++ b/spec/features/projects/guest_navigation_menu_spec.rb @@ -13,7 +13,7 @@ describe 'Guest navigation menu' do it 'shows allowed tabs only' do visit project_path(project) - within('.layout-nav') do + within('.nav-sidebar') do expect(page).to have_content 'Project' expect(page).to have_content 'Issues' expect(page).to have_content 'Wiki' diff --git a/spec/features/projects/project_settings_spec.rb b/spec/features/projects/project_settings_spec.rb index 80d91e5915f..5d77cd1ccd5 100644 --- a/spec/features/projects/project_settings_spec.rb +++ b/spec/features/projects/project_settings_spec.rb @@ -46,7 +46,7 @@ describe 'Edit Project Settings' do context 'when changing project name' do it 'renames the repository' do rename_project(project, name: 'bar') - expect(find('h1.title')).to have_content(project.name) + expect(find('.breadcrumbs')).to have_content(project.name) end context 'with emojis' do @@ -74,7 +74,7 @@ describe 'Edit Project Settings' do new_path = namespace_project_path(project.namespace, 'bar') visit new_path expect(current_path).to eq(new_path) - expect(find('h1.title')).to have_content(project.name) + expect(find('.breadcrumbs')).to have_content(project.name) end specify 'the project is accessible via a redirect from the old path' do @@ -83,7 +83,7 @@ describe 'Edit Project Settings' do new_path = namespace_project_path(project.namespace, 'bar') visit old_path expect(current_path).to eq(new_path) - expect(find('h1.title')).to have_content(project.name) + expect(find('.breadcrumbs')).to have_content(project.name) end context 'and a new project is added with the same path' do @@ -93,7 +93,7 @@ describe 'Edit Project Settings' do new_project = create(:project, namespace: user.namespace, path: 'gitlabhq', name: 'quz') visit old_path expect(current_path).to eq(old_path) - expect(find('h1.title')).to have_content(new_project.name) + expect(find('.breadcrumbs')).to have_content(new_project.name) end end end @@ -120,7 +120,7 @@ describe 'Edit Project Settings' do new_path = namespace_project_path(group, project) visit new_path expect(current_path).to eq(new_path) - expect(find('h1.title')).to have_content(project.name) + expect(find('.breadcrumbs')).to have_content(project.name) end specify 'the project is accessible via a redirect from the old path' do @@ -129,7 +129,7 @@ describe 'Edit Project Settings' do new_path = namespace_project_path(group, project) visit old_path expect(current_path).to eq(new_path) - expect(find('h1.title')).to have_content(project.name) + expect(find('.breadcrumbs')).to have_content(project.name) end context 'and a new project is added with the same path' do @@ -139,7 +139,7 @@ describe 'Edit Project Settings' do new_project = create(:project, namespace: user.namespace, path: 'gitlabhq', name: 'quz') visit old_path expect(current_path).to eq(old_path) - expect(find('h1.title')).to have_content(new_project.name) + expect(find('.breadcrumbs')).to have_content(new_project.name) end end end diff --git a/spec/features/projects/sub_group_issuables_spec.rb b/spec/features/projects/sub_group_issuables_spec.rb index aaf64d42515..b2b39dbd24c 100644 --- a/spec/features/projects/sub_group_issuables_spec.rb +++ b/spec/features/projects/sub_group_issuables_spec.rb @@ -24,7 +24,7 @@ describe 'Subgroup Issuables', :js, :nested_groups do end def expect_to_have_full_subgroup_title - title = find('.title-container') + title = find('.breadcrumbs-links') expect(title).not_to have_selector '.initializing' expect(title).to have_content 'group / subgroup / project' |