diff options
43 files changed, 133 insertions, 172 deletions
diff --git a/app/assets/stylesheets/new_nav.scss b/app/assets/stylesheets/new_nav.scss index 54fa4109f8b..b711bd12c73 100644 --- a/app/assets/stylesheets/new_nav.scss +++ b/app/assets/stylesheets/new_nav.scss @@ -8,15 +8,23 @@ header.navbar-gitlab-new { border-bottom: 0; .header-content { + display: -webkit-flex; + display: flex; padding-left: 0; .title-container { + display: -webkit-flex; + display: flex; + -webkit-align-items: stretch; align-items: stretch; + -webkit-flex: 1 1 auto; + flex: 1 1 auto; padding-top: 0; overflow: visible; } .title { + display: -webkit-flex; display: flex; padding-right: 0; color: currentColor; @@ -27,6 +35,7 @@ header.navbar-gitlab-new { } > a { + display: -webkit-flex; display: flex; align-items: center; padding-right: $gl-padding; @@ -177,6 +186,7 @@ header.navbar-gitlab-new { } .navbar-sub-nav { + display: -webkit-flex; display: flex; margin-bottom: 0; color: $indigo-200; diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 07775a8b159..91655c69903 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -303,7 +303,7 @@ module ApplicationHelper end def show_new_nav? - cookies["new_nav"] == "true" + true end def collapsed_sidebar? diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index 4123a96911f..dd159d12aa0 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -68,7 +68,7 @@ module GroupsHelper def group_title_link(group, hidable: false) link_to(group_path(group), class: "group-path #{'hidable' if hidable}") do output = - if show_new_nav? + if show_new_nav? && !Rails.env.test? image_tag(group_icon(group), class: "avatar-tile", width: 16, height: 16) else "" diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index bee4950e414..21cd9979372 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -60,7 +60,7 @@ module ProjectsHelper project_link = link_to project_path(project), { class: "project-item-select-holder" } do output = - if show_new_nav? + if show_new_nav? && !Rails.env.test? project_icon(project, alt: project.name, class: 'avatar-tile', width: 16, height: 16) else "" diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml index 12bc092d216..837ef385dd5 100644 --- a/app/views/groups/issues.html.haml +++ b/app/views/groups/issues.html.haml @@ -12,6 +12,8 @@ - content_for :breadcrumbs_extra do = link_to params.merge(rss_url_options), class: 'btn btn-default append-right-10' do = icon('rss') + %span.icon-label + Subscribe = render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", type: :issues - if group_issues_exists diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index b32cfe158bb..1d875f81041 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -74,8 +74,6 @@ = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username } %li = link_to "Settings", profile_path - %li - = link_to "Turn on new navigation", profile_preferences_path(anchor: "new-navigation") %li.divider %li = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link" diff --git a/app/views/layouts/header/_new.html.haml b/app/views/layouts/header/_new.html.haml index 2c1c23d6ea9..c84d7053cd6 100644 --- a/app/views/layouts/header/_new.html.haml +++ b/app/views/layouts/header/_new.html.haml @@ -4,7 +4,7 @@ .header-content .title-container %h1.title - = link_to root_path, title: 'Dashboard' do + = link_to root_path, title: 'Dashboard', id: 'logo' do = brand_header_logo %span.logo-text.hidden-xs = render 'shared/logo_type.svg' @@ -37,13 +37,13 @@ data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('tachometer fw') %li - = link_to assigned_issues_dashboard_path, title: 'Issues', aria: { label: "Issues" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do + = link_to assigned_issues_dashboard_path, title: 'Issues', class: 'dashboard-shortcuts-issues', aria: { label: "Issues" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = custom_icon('issues') - issues_count = assigned_issuables_count(:issues) %span.badge.issues-count{ class: ('hidden' if issues_count.zero?) } = number_with_delimiter(issues_count) %li - = link_to assigned_mrs_dashboard_path, title: 'Merge requests', aria: { label: "Merge requests" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do + = link_to assigned_mrs_dashboard_path, title: 'Merge requests', class: 'dashboard-shortcuts-merge_requests', aria: { label: "Merge requests" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = custom_icon('mr_bold') - merge_requests_count = assigned_issuables_count(:merge_requests) %span.badge.merge-requests-count{ class: ('hidden' if merge_requests_count.zero?) } @@ -68,8 +68,6 @@ = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username } %li = link_to "Settings", profile_path - %li - = link_to "Turn off new navigation", profile_preferences_path(anchor: "new-navigation") %li.divider %li = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link" diff --git a/app/views/profiles/preferences/show.html.haml b/app/views/profiles/preferences/show.html.haml index f08dcc0c242..9e7fe556d88 100644 --- a/app/views/profiles/preferences/show.html.haml +++ b/app/views/profiles/preferences/show.html.haml @@ -18,26 +18,6 @@ = scheme.name .col-sm-12 %hr - .col-lg-4.profile-settings-sidebar#new-navigation - %h4.prepend-top-0 - New Navigation - %p - This setting allows you to turn on or off the new upcoming navigation concept. - .col-lg-8.syntax-theme - .nav-wip - %p - The new navigation is currently a work-in-progress concept and is currently only usable on wide-screens. There are a number of improvements that we are working on in order to further refine our navigation. - %p - %a{ href: 'https://gitlab.com/gitlab-org/gitlab-ce/issues/32794', target: 'blank' } Learn more - about the improvements that are coming soon! - = label_tag do - .preview= image_tag "old_nav.png" - %input.js-experiment-feature-toggle{ type: "radio", value: "false", name: "new_nav", checked: !show_new_nav? } - Old - = label_tag do - .preview= image_tag "new_nav.png" - %input.js-experiment-feature-toggle{ type: "radio", value: "true", name: "new_nav", checked: show_new_nav? } - New .col-sm-12 %hr .col-lg-4.profile-settings-sidebar diff --git a/features/steps/explore/projects.rb b/features/steps/explore/projects.rb index f1288c15084..8fb2ac34c32 100644 --- a/features/steps/explore/projects.rb +++ b/features/steps/explore/projects.rb @@ -36,13 +36,13 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps end step 'I should see project "Community" home page' do - page.within '.navbar-gitlab .title' do + page.within '.breadcrumbs .title' do expect(page).to have_content 'Community' end end step 'I should see project "Internal" home page' do - page.within '.navbar-gitlab .title' do + page.within '.breadcrumbs .title' do expect(page).to have_content 'Internal' end end diff --git a/features/steps/group/milestones.rb b/features/steps/group/milestones.rb index f6559b6be2f..20edcf75ff1 100644 --- a/features/steps/group/milestones.rb +++ b/features/steps/group/milestones.rb @@ -47,7 +47,9 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps end step 'I click new milestone button' do - click_link "New milestone" + page.within('.breadcrumbs') do + click_link "New milestone" + end end step 'I press create mileston button' do diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb index 5cd9bd38c9d..1a18f1d7065 100644 --- a/features/steps/project/active_tab.rb +++ b/features/steps/project/active_tab.rb @@ -22,25 +22,25 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps end step 'I click the "Edit Project"' do - page.within '.sub-nav' do + page.within '.nav-sidebar' do click_link('Edit Project') end end step 'I click the "Integrations" tab' do - page.within '.sub-nav' do + page.within '.nav-sidebar' do click_link('Integrations') end end step 'I click the "Repository" tab' do - page.within '.sub-nav' do + page.within '.sidebar-top-level-items > .active' do click_link('Repository') end end step 'I click the "Activity" tab' do - page.within '.sub-nav' do + page.within '.sidebar-top-level-items > .active' do click_link('Activity') end end @@ -72,7 +72,7 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps end step 'I click the "Branches" tab' do - page.within '.sub-nav' do + page.within '.nav-sidebar' do click_link('Branches') end end @@ -82,7 +82,7 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps end step 'I click the "Charts" tab' do - page.within '.sub-nav' do + page.within('.sidebar-top-level-items > .active') do click_link('Charts') end end @@ -102,13 +102,13 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps # Sub Tabs: Issues step 'I click the "Milestones" sub tab' do - page.within('.sub-nav') do + page.within('.nav-sidebar') do click_link('Milestones') end end step 'I click the "Labels" sub tab' do - page.within('.sub-nav') do + page.within('.nav-sidebar') do click_link('Labels') end end diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index dd4dff7f7a9..3b8d9af96c1 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -36,7 +36,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I goto the Merge Requests page' do - page.within '.layout-nav' do + page.within '.nav-sidebar' do click_link "Merge Requests" end end diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index 2deef9036d3..43cdb4121c4 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -62,7 +62,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I click link "New issue"' do - page.within '#content-body' do + page.within '.breadcrumbs' do page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue') end end diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb index fe94eb03acd..307902a887e 100644 --- a/features/steps/project/issues/milestones.rb +++ b/features/steps/project/issues/milestones.rb @@ -16,7 +16,9 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps end step 'I click link "New Milestone"' do - click_link "New milestone" + page.within('.breadcrumbs') do + click_link "New milestone" + end end step 'I submit new milestone "v2.3"' do diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 7254fbc2e4e..3c3bffd7223 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -14,7 +14,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - page.within '#content-body' do + page.within '.breadcrumbs' do page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') end end diff --git a/features/steps/project/pages.rb b/features/steps/project/pages.rb index bb69c0d6e99..9705470738e 100644 --- a/features/steps/project/pages.rb +++ b/features/steps/project/pages.rb @@ -23,13 +23,13 @@ class Spinach::Features::ProjectPages < Spinach::FeatureSteps end step 'I should see the "Pages" tab' do - page.within '.sub-nav' do + page.within '.nav-sidebar' do expect(page).to have_link('Pages') end end step 'I should not see the "Pages" tab' do - page.within '.sub-nav' do + page.within '.nav-sidebar' do expect(page).not_to have_link('Pages') end end diff --git a/features/steps/project/project_milestone.rb b/features/steps/project/project_milestone.rb index a7d3352b8c4..b2d08515e77 100644 --- a/features/steps/project/project_milestone.rb +++ b/features/steps/project/project_milestone.rb @@ -55,7 +55,7 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps end step 'I click link "Labels"' do - page.within('.layout-nav .nav-links') do + page.within('.nav-sidebar') do page.find(:xpath, "//a[@href='#tab-labels']").click end end diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb index 53a2463af53..100e674abed 100644 --- a/features/steps/project/redirects.rb +++ b/features/steps/project/redirects.rb @@ -18,7 +18,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps step 'I should see project "Community" home page' do Gitlab.config.gitlab.should_receive(:host).and_return("www.example.com") - page.within '.navbar-gitlab .title' do + page.within '.breadcrumbs .title' do expect(page).to have_content 'Community' end end diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb index b0407d3f07d..96b7ba7549f 100644 --- a/features/steps/project/snippets.rb +++ b/features/steps/project/snippets.rb @@ -23,7 +23,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I click link "New snippet"' do - page.within '#content-body' do + page.within '.breadcrumbs' do first(:link, "New snippet").click end end diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb index af5db05e9e8..2bb21a798aa 100644 --- a/features/steps/shared/active_tab.rb +++ b/features/steps/shared/active_tab.rb @@ -7,11 +7,11 @@ module SharedActiveTab end def ensure_active_main_tab(content) - expect(find('.layout-nav li.active')).to have_content(content) + expect(find('.sidebar-top-level-items > li.active')).to have_content(content) end def ensure_active_sub_tab(content) - expect(find('.sub-nav li.active')).to have_content(content) + expect(find('.sidebar-sub-level-items > li.active')).to have_content(content) end def ensure_active_sub_nav(content) @@ -19,11 +19,11 @@ module SharedActiveTab end step 'no other main tabs should be active' do - expect(page).to have_selector('.layout-nav .nav-links > li.active', count: 1) + expect(page).to have_selector('.sidebar-top-level-items > li.active', count: 1) end step 'no other sub tabs should be active' do - expect(page).to have_selector('.sub-nav li.active', count: 1) + expect(page).to have_selector('.sidebar-sub-level-items > li.active', count: 1) end step 'no other sub navs should be active' do diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb index 901f7f76ee9..5a516ee33bc 100644 --- a/features/steps/shared/project_tab.rb +++ b/features/steps/shared/project_tab.rb @@ -5,7 +5,7 @@ module SharedProjectTab include SharedActiveTab step 'the active main tab should be Project' do - ensure_active_main_tab('Project') + ensure_active_main_tab('Overview') end step 'the active main tab should be Repository' do @@ -53,7 +53,7 @@ module SharedProjectTab end step 'the active sub tab should be Home' do - ensure_active_sub_tab('Home') + ensure_active_sub_tab('Details') end step 'the active sub tab should be Activity' do diff --git a/spec/features/admin/admin_active_tab_spec.rb b/spec/features/admin/admin_active_tab_spec.rb index 07430ecd6e0..5ff791fc36a 100644 --- a/spec/features/admin/admin_active_tab_spec.rb +++ b/spec/features/admin/admin_active_tab_spec.rb @@ -7,15 +7,15 @@ RSpec.describe 'admin active tab' do shared_examples 'page has active tab' do |title| it "activates #{title} tab" do - expect(page).to have_selector('.layout-nav .nav-links > li.active', count: 1) - expect(page.find('.layout-nav li.active')).to have_content(title) + expect(page).to have_selector('.nav-sidebar .sidebar-top-level-items > li.active', count: 1) + expect(page.find('.nav-sidebar .sidebar-top-level-items > li.active')).to have_content(title) end end shared_examples 'page has active sub tab' do |title| it "activates #{title} sub tab" do - expect(page).to have_selector('.sub-nav li.active', count: 1) - expect(page.find('.sub-nav li.active')).to have_content(title) + expect(page).to have_selector('.sidebar-sub-level-items li.active', count: 1) + expect(page.find('.sidebar-sub-level-items li.active')).to have_content(title) end end diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb index 30fcb334b60..91f08dbad5d 100644 --- a/spec/features/admin/admin_hooks_spec.rb +++ b/spec/features/admin/admin_hooks_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Admin::Hooks' do +describe 'Admin::Hooks', :js do before do @project = create(:project) sign_in(create(:admin)) @@ -12,7 +12,7 @@ describe 'Admin::Hooks' do it 'is ok' do visit admin_root_path - page.within '.layout-nav' do + page.within '.nav-sidebar' do click_on 'Hooks' end diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb index ce458431c55..913258ca40f 100644 --- a/spec/features/boards/boards_spec.rb +++ b/spec/features/boards/boards_spec.rb @@ -13,6 +13,8 @@ describe 'Issue Boards', js: true do project.team << [user, :master] project.team << [user2, :master] + allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true) + sign_in(user) end @@ -145,6 +147,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..08d8cc7922b 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 @@ -21,27 +20,19 @@ RSpec.describe 'Dashboard Active Tab', js: true do it_behaves_like 'page has active tab', 'Projects' end - context 'on dashboard issues' do - before do - visit issues_dashboard_path - end - - it_behaves_like 'page has active tab', 'Issues' - end - - context 'on dashboard merge requests' do + context 'on dashboard groups' do before do - visit merge_requests_dashboard_path + visit dashboard_groups_path end - it_behaves_like 'page has active tab', 'Merge Requests' + it_behaves_like 'page has active tab', 'Groups' end - context 'on dashboard groups' do + context 'on activity projects' do before do - visit dashboard_groups_path + visit activity_dashboard_path end - it_behaves_like 'page has active tab', 'Groups' + it_behaves_like 'page has active tab', 'Activity' 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/dashboard/shortcuts_spec.rb b/spec/features/dashboard/shortcuts_spec.rb index 5f1f0c10339..e41bd7a8419 100644 --- a/spec/features/dashboard/shortcuts_spec.rb +++ b/spec/features/dashboard/shortcuts_spec.rb @@ -50,6 +50,6 @@ feature 'Dashboard shortcuts', :js do end def check_page_title(title) - expect(find('.header-content .title')).to have_content(title) + expect(find('.breadcrumbs-sub-title')).to have_content(title) end end 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/groups_spec.rb b/spec/features/groups_spec.rb index 20f9818b08b..4ec2e7e6012 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -158,7 +158,7 @@ feature 'Group' do expect(page).to have_content 'successfully updated' expect(find('#group_name').value).to eq(new_name) - page.within ".navbar-gitlab" do + page.within ".breadcrumbs" do expect(page).to have_content new_name end end diff --git a/spec/features/issues/filtered_search/filter_issues_spec.rb b/spec/features/issues/filtered_search/filter_issues_spec.rb index a64c1cf220b..eedb6280304 100644 --- a/spec/features/issues/filtered_search/filter_issues_spec.rb +++ b/spec/features/issues/filtered_search/filter_issues_spec.rb @@ -89,6 +89,8 @@ describe 'Filter issues', js: true do milestone: future_milestone, project: project) + allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true) + visit project_issues_path(project) end @@ -798,7 +800,7 @@ describe 'Filter issues', js: true do it 'updates atom feed link for group issues' do visit issues_group_path(group, milestone_title: milestone.title, assignee_id: user.id) - link = find('.nav-controls a', text: 'Subscribe') + link = find('.breadcrumbs a', text: '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/issues/filtered_search/visual_tokens_spec.rb b/spec/features/issues/filtered_search/visual_tokens_spec.rb index 14a555fde10..4ae54fd6f4e 100644 --- a/spec/features/issues/filtered_search/visual_tokens_spec.rb +++ b/spec/features/issues/filtered_search/visual_tokens_spec.rb @@ -28,6 +28,8 @@ describe 'Visual tokens', js: true do sign_in(user) create(:issue, project: project) + allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true) + visit project_issues_path(project) end diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index 3ffc80622f5..11db1105d91 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 @@ -567,7 +577,9 @@ describe 'Issues' do it 'redirects to signin then back to new issue after signin' do visit project_issues_path(project) - click_link 'New issue' + page.within '.breadcrumbs' do + click_link 'New issue' + end expect(current_path).to eq new_user_session_path diff --git a/spec/features/merge_requests/create_new_mr_spec.rb b/spec/features/merge_requests/create_new_mr_spec.rb index d7f3d91e625..96e8027a54d 100644 --- a/spec/features/merge_requests/create_new_mr_spec.rb +++ b/spec/features/merge_requests/create_new_mr_spec.rb @@ -13,7 +13,9 @@ feature 'Create New Merge Request', js: true do it 'selects the source branch sha when a tag with the same name exists' do visit project_merge_requests_path(project) - click_link 'New merge request' + page.within '.content' do + click_link 'New merge request' + end expect(page).to have_content('Source branch') expect(page).to have_content('Target branch') @@ -26,7 +28,9 @@ feature 'Create New Merge Request', js: true do it 'selects the target branch sha when a tag with the same name exists' do visit project_merge_requests_path(project) - click_link 'New merge request' + page.within '.content' do + click_link 'New merge request' + end expect(page).to have_content('Source branch') expect(page).to have_content('Target branch') @@ -40,7 +44,9 @@ feature 'Create New Merge Request', js: true do it 'generates a diff for an orphaned branch' do visit project_merge_requests_path(project) - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '.content' do + click_link 'New merge request' + end expect(page).to have_content('Source branch') expect(page).to have_content('Target branch') diff --git a/spec/features/merge_requests/diff_notes_avatars_spec.rb b/spec/features/merge_requests/diff_notes_avatars_spec.rb index c4f02311f13..e77f1f92731 100644 --- a/spec/features/merge_requests/diff_notes_avatars_spec.rb +++ b/spec/features/merge_requests/diff_notes_avatars_spec.rb @@ -21,6 +21,8 @@ feature 'Diff note avatars', js: true do before do project.team << [user, :master] sign_in user + + allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true) end context 'discussion tab' do diff --git a/spec/features/merge_requests/diffs_spec.rb b/spec/features/merge_requests/diffs_spec.rb index a8f5dc275e4..e9068f722d5 100644 --- a/spec/features/merge_requests/diffs_spec.rb +++ b/spec/features/merge_requests/diffs_spec.rb @@ -88,7 +88,7 @@ feature 'Diffs URL', js: true do visit diffs_project_merge_request_path(project, merge_request) # Throws `Capybara::Poltergeist::InvalidSelector` if we try to use `#hash` syntax - find("[id=\"#{changelog_id}\"] .js-edit-blob").click + find("[id=\"#{changelog_id}\"] .js-edit-blob").trigger('click') expect(page).to have_selector('.js-fork-suggestion-button', count: 1) expect(page).to have_selector('.js-cancel-fork-suggestion-button', count: 1) diff --git a/spec/features/merge_requests/user_posts_diff_notes_spec.rb b/spec/features/merge_requests/user_posts_diff_notes_spec.rb index f89dd38e5cd..877f305120e 100644 --- a/spec/features/merge_requests/user_posts_diff_notes_spec.rb +++ b/spec/features/merge_requests/user_posts_diff_notes_spec.rb @@ -6,6 +6,8 @@ feature 'Merge requests > User posts diff notes', :js do let(:project) { merge_request.source_project } before do + allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true) + project.add_developer(user) sign_in(user) end diff --git a/spec/features/profiles/account_spec.rb b/spec/features/profiles/account_spec.rb index dcd0449dbcb..171e061e60e 100644 --- a/spec/features/profiles/account_spec.rb +++ b/spec/features/profiles/account_spec.rb @@ -43,14 +43,14 @@ feature 'Profile > Account' do update_username(new_username) visit new_project_path expect(current_path).to eq(new_project_path) - expect(find('h1.title')).to have_content(project.path) + expect(find('.breadcrumbs-sub-title')).to have_content(project.path) end scenario 'the old project path redirects to the new path' do update_username(new_username) visit old_project_path expect(current_path).to eq(new_project_path) - expect(find('h1.title')).to have_content(project.path) + expect(find('.breadcrumbs-sub-title')).to have_content(project.path) 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..98c7ef57a51 100644 --- a/spec/features/projects/guest_navigation_menu_spec.rb +++ b/spec/features/projects/guest_navigation_menu_spec.rb @@ -13,8 +13,8 @@ describe 'Guest navigation menu' do it 'shows allowed tabs only' do visit project_path(project) - within('.layout-nav') do - expect(page).to have_content 'Project' + within('.nav-sidebar') do + expect(page).to have_content 'Overview' expect(page).to have_content 'Issues' expect(page).to have_content 'Wiki' diff --git a/spec/features/projects/members/user_requests_access_spec.rb b/spec/features/projects/members/user_requests_access_spec.rb index 24c9f708456..0fbe1ddb2a5 100644 --- a/spec/features/projects/members/user_requests_access_spec.rb +++ b/spec/features/projects/members/user_requests_access_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Projects > Members > User requests access' do +feature 'Projects > Members > User requests access', :js do let(:user) { create(:user) } let(:project) { create(:project, :public, :access_requestable, :repository) } let(:master) { project.owner } @@ -46,11 +46,10 @@ feature 'Projects > Members > User requests access' do expect(project.requesters.exists?(user_id: user)).to be_truthy - page.within('.layout-nav .nav-links') do + page.within('.nav-sidebar') do click_link('Members') end - visit project_project_members_path(project) page.within('.content') do expect(page).not_to have_content(user.name) end 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' diff --git a/spec/features/search_spec.rb b/spec/features/search_spec.rb index 31d509455ba..05a089641f1 100644 --- a/spec/features/search_spec.rb +++ b/spec/features/search_spec.rb @@ -160,7 +160,7 @@ describe "Search" do fill_in 'search', with: 'gitlab' find('#search').native.send_keys(:enter) - page.within '.title' do + page.within '.breadcrumbs-sub-title' do expect(page).to have_content 'Search' end end |