Commit 989bebbf authored by Tim Zallmann's avatar Tim Zallmann

Merge branch 'enable-new-navigaton-by-default' into 'master'

Enable the new navigation by default

See merge request !13387
parents 4a7bb1a8 4d2d744a
...@@ -8,15 +8,23 @@ header.navbar-gitlab-new { ...@@ -8,15 +8,23 @@ header.navbar-gitlab-new {
border-bottom: 0; border-bottom: 0;
.header-content { .header-content {
display: -webkit-flex;
display: flex;
padding-left: 0; padding-left: 0;
.title-container { .title-container {
display: -webkit-flex;
display: flex;
-webkit-align-items: stretch;
align-items: stretch; align-items: stretch;
-webkit-flex: 1 1 auto;
flex: 1 1 auto;
padding-top: 0; padding-top: 0;
overflow: visible; overflow: visible;
} }
.title { .title {
display: -webkit-flex;
display: flex; display: flex;
padding-right: 0; padding-right: 0;
color: currentColor; color: currentColor;
...@@ -27,6 +35,7 @@ header.navbar-gitlab-new { ...@@ -27,6 +35,7 @@ header.navbar-gitlab-new {
} }
> a { > a {
display: -webkit-flex;
display: flex; display: flex;
align-items: center; align-items: center;
padding-right: $gl-padding; padding-right: $gl-padding;
...@@ -177,6 +186,7 @@ header.navbar-gitlab-new { ...@@ -177,6 +186,7 @@ header.navbar-gitlab-new {
} }
.navbar-sub-nav { .navbar-sub-nav {
display: -webkit-flex;
display: flex; display: flex;
margin-bottom: 0; margin-bottom: 0;
color: $indigo-200; color: $indigo-200;
......
...@@ -303,7 +303,7 @@ module ApplicationHelper ...@@ -303,7 +303,7 @@ module ApplicationHelper
end end
def show_new_nav? def show_new_nav?
cookies["new_nav"] == "true" true
end end
def collapsed_sidebar? def collapsed_sidebar?
......
...@@ -68,7 +68,7 @@ module GroupsHelper ...@@ -68,7 +68,7 @@ module GroupsHelper
def group_title_link(group, hidable: false) def group_title_link(group, hidable: false)
link_to(group_path(group), class: "group-path #{'hidable' if hidable}") do link_to(group_path(group), class: "group-path #{'hidable' if hidable}") do
output = output =
if show_new_nav? if show_new_nav? && !Rails.env.test?
image_tag(group_icon(group), class: "avatar-tile", width: 16, height: 16) image_tag(group_icon(group), class: "avatar-tile", width: 16, height: 16)
else else
"" ""
......
...@@ -62,7 +62,7 @@ module ProjectsHelper ...@@ -62,7 +62,7 @@ module ProjectsHelper
project_link = link_to project_path(project), { class: "project-item-select-holder" } do project_link = link_to project_path(project), { class: "project-item-select-holder" } do
output = 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) project_icon(project, alt: project.name, class: 'avatar-tile', width: 16, height: 16)
else else
"" ""
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
- content_for :breadcrumbs_extra do - content_for :breadcrumbs_extra do
= link_to params.merge(rss_url_options), class: 'btn btn-default append-right-10' do = link_to params.merge(rss_url_options), class: 'btn btn-default append-right-10' do
= icon('rss') = icon('rss')
%span.icon-label
Subscribe
= render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", type: :issues = render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", type: :issues
- if group_issues_exists - if group_issues_exists
......
...@@ -74,8 +74,6 @@ ...@@ -74,8 +74,6 @@
= link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username } = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username }
%li %li
= link_to "Settings", profile_path = link_to "Settings", profile_path
%li
= link_to "Turn on new navigation", profile_preferences_path(anchor: "new-navigation")
%li.divider %li.divider
%li %li
= link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link" = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
.header-content .header-content
.title-container .title-container
%h1.title %h1.title
= link_to root_path, title: 'Dashboard' do = link_to root_path, title: 'Dashboard', id: 'logo' do
= brand_header_logo = brand_header_logo
%span.logo-text.hidden-xs %span.logo-text.hidden-xs
= render 'shared/logo_type.svg' = render 'shared/logo_type.svg'
...@@ -37,13 +37,13 @@ ...@@ -37,13 +37,13 @@
data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= icon('tachometer fw') = icon('tachometer fw')
%li %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') = custom_icon('issues')
- issues_count = assigned_issuables_count(:issues) - issues_count = assigned_issuables_count(:issues)
%span.badge.issues-count{ class: ('hidden' if issues_count.zero?) } %span.badge.issues-count{ class: ('hidden' if issues_count.zero?) }
= number_with_delimiter(issues_count) = number_with_delimiter(issues_count)
%li %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') = custom_icon('mr_bold')
- merge_requests_count = assigned_issuables_count(:merge_requests) - merge_requests_count = assigned_issuables_count(:merge_requests)
%span.badge.merge-requests-count{ class: ('hidden' if merge_requests_count.zero?) } %span.badge.merge-requests-count{ class: ('hidden' if merge_requests_count.zero?) }
...@@ -68,8 +68,6 @@ ...@@ -68,8 +68,6 @@
= link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username } = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username }
%li %li
= link_to "Settings", profile_path = link_to "Settings", profile_path
%li
= link_to "Turn off new navigation", profile_preferences_path(anchor: "new-navigation")
%li.divider %li.divider
%li %li
= link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link" = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link"
......
...@@ -18,26 +18,6 @@ ...@@ -18,26 +18,6 @@
= scheme.name = scheme.name
.col-sm-12 .col-sm-12
%hr %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 .col-sm-12
%hr %hr
.col-lg-4.profile-settings-sidebar .col-lg-4.profile-settings-sidebar
......
...@@ -36,13 +36,13 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps ...@@ -36,13 +36,13 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
end end
step 'I should see project "Community" home page' do 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' expect(page).to have_content 'Community'
end end
end end
step 'I should see project "Internal" home page' do 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' expect(page).to have_content 'Internal'
end end
end end
......
...@@ -47,8 +47,10 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps ...@@ -47,8 +47,10 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
end end
step 'I click new milestone button' do step 'I click new milestone button' do
page.within('.breadcrumbs') do
click_link "New milestone" click_link "New milestone"
end end
end
step 'I press create mileston button' do step 'I press create mileston button' do
click_button "Create milestone" click_button "Create milestone"
......
...@@ -22,25 +22,25 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps ...@@ -22,25 +22,25 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
end end
step 'I click the "Edit Project"' do step 'I click the "Edit Project"' do
page.within '.sub-nav' do page.within '.nav-sidebar' do
click_link('Edit Project') click_link('Edit Project')
end end
end end
step 'I click the "Integrations" tab' do step 'I click the "Integrations" tab' do
page.within '.sub-nav' do page.within '.nav-sidebar' do
click_link('Integrations') click_link('Integrations')
end end
end end
step 'I click the "Repository" tab' do step 'I click the "Repository" tab' do
page.within '.sub-nav' do page.within '.sidebar-top-level-items > .active' do
click_link('Repository') click_link('Repository')
end end
end end
step 'I click the "Activity" tab' do step 'I click the "Activity" tab' do
page.within '.sub-nav' do page.within '.sidebar-top-level-items > .active' do
click_link('Activity') click_link('Activity')
end end
end end
...@@ -72,7 +72,7 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps ...@@ -72,7 +72,7 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
end end
step 'I click the "Branches" tab' do step 'I click the "Branches" tab' do
page.within '.sub-nav' do page.within '.nav-sidebar' do
click_link('Branches') click_link('Branches')
end end
end end
...@@ -82,7 +82,7 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps ...@@ -82,7 +82,7 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
end end
step 'I click the "Charts" tab' do step 'I click the "Charts" tab' do
page.within '.sub-nav' do page.within('.sidebar-top-level-items > .active') do
click_link('Charts') click_link('Charts')
end end
end end
...@@ -102,13 +102,13 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps ...@@ -102,13 +102,13 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
# Sub Tabs: Issues # Sub Tabs: Issues
step 'I click the "Milestones" sub tab' do step 'I click the "Milestones" sub tab' do
page.within('.sub-nav') do page.within('.nav-sidebar') do
click_link('Milestones') click_link('Milestones')
end end
end end
step 'I click the "Labels" sub tab' do step 'I click the "Labels" sub tab' do
page.within('.sub-nav') do page.within('.nav-sidebar') do
click_link('Labels') click_link('Labels')
end end
end end
......
...@@ -36,7 +36,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps ...@@ -36,7 +36,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
end end
step 'I goto the Merge Requests page' do step 'I goto the Merge Requests page' do
page.within '.layout-nav' do page.within '.nav-sidebar' do
click_link "Merge Requests" click_link "Merge Requests"
end end
end end
......
...@@ -62,7 +62,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps ...@@ -62,7 +62,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end end
step 'I click link "New issue"' do 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') page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue')
end end
end end
......
...@@ -16,8 +16,10 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps ...@@ -16,8 +16,10 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
end end
step 'I click link "New Milestone"' do step 'I click link "New Milestone"' do
page.within('.breadcrumbs') do
click_link "New milestone" click_link "New milestone"
end end
end
step 'I submit new milestone "v2.3"' do step 'I submit new milestone "v2.3"' do
fill_in "milestone_title", with: "v2.3" fill_in "milestone_title", with: "v2.3"
......
...@@ -14,7 +14,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -14,7 +14,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end end
step 'I click link "New Merge Request"' do 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') page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request')
end end
end end
......
...@@ -23,13 +23,13 @@ class Spinach::Features::ProjectPages < Spinach::FeatureSteps ...@@ -23,13 +23,13 @@ class Spinach::Features::ProjectPages < Spinach::FeatureSteps
end end
step 'I should see the "Pages" tab' do step 'I should see the "Pages" tab' do
page.within '.sub-nav' do page.within '.nav-sidebar' do
expect(page).to have_link('Pages') expect(page).to have_link('Pages')
end end
end end
step 'I should not see the "Pages" tab' do 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') expect(page).not_to have_link('Pages')
end end
end end
......
...@@ -55,7 +55,7 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps ...@@ -55,7 +55,7 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps
end end
step 'I click link "Labels"' do 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 page.find(:xpath, "//a[@href='#tab-labels']").click
end end
end end
......
...@@ -18,7 +18,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps ...@@ -18,7 +18,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
step 'I should see project "Community" home page' do step 'I should see project "Community" home page' do
Gitlab.config.gitlab.should_receive(:host).and_return("www.example.com") 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' expect(page).to have_content 'Community'
end end
end end
......
...@@ -23,7 +23,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps ...@@ -23,7 +23,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
end end
step 'I click link "New snippet"' do step 'I click link "New snippet"' do
page.within '#content-body' do page.within '.breadcrumbs' do
first(:link, "New snippet").click first(:link, "New snippet").click
end end
end end
......
...@@ -7,11 +7,11 @@ module SharedActiveTab ...@@ -7,11 +7,11 @@ module SharedActiveTab
end end
def ensure_active_main_tab(content) 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 end
def ensure_active_sub_tab(content) 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 end
def ensure_active_sub_nav(content) def ensure_active_sub_nav(content)
...@@ -19,11 +19,11 @@ module SharedActiveTab ...@@ -19,11 +19,11 @@ module SharedActiveTab
end end
step 'no other main tabs should be active' do 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 end
step 'no other sub tabs should be active' do 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 end
step 'no other sub navs should be active' do step 'no other sub navs should be active' do
......
...@@ -5,7 +5,7 @@ module SharedProjectTab ...@@ -5,7 +5,7 @@ module SharedProjectTab
include SharedActiveTab include SharedActiveTab
step 'the active main tab should be Project' do step 'the active main tab should be Project' do
ensure_active_main_tab('Project') ensure_active_main_tab('Overview')
end end
step 'the active main tab should be Repository' do step 'the active main tab should be Repository' do
...@@ -53,7 +53,7 @@ module SharedProjectTab ...@@ -53,7 +53,7 @@ module SharedProjectTab
end end
step 'the active sub tab should be Home' do step 'the active sub tab should be Home' do
ensure_active_sub_tab('Home') ensure_active_sub_tab('Details')
end end
step 'the active sub tab should be Activity' do step 'the active sub tab should be Activity' do
......
...@@ -7,15 +7,15 @@ RSpec.describe 'admin active tab' do ...@@ -7,15 +7,15 @@ RSpec.describe 'admin active tab' do
shared_examples 'page has active tab' do |title| shared_examples 'page has active tab' do |title|
it "activates #{title} tab" do it "activates #{title} tab" do
expect(page).to have_selector('.layout-nav .nav-links > li.active', count: 1) expect(page).to have_selector('.nav-sidebar .sidebar-top-level-items > li.active', count: 1)
expect(page.find('.layout-nav li.active')).to have_content(title) expect(page.find('.nav-sidebar .sidebar-top-level-items > li.active')).to have_content(title)
end end
end end
shared_examples 'page has active sub tab' do |title| shared_examples 'page has active sub tab' do |title|
it "activates #{title} sub tab" do it "activates #{title} sub tab" 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)
expect(page.find('.sub-nav li.active')).to have_content(title) expect(page.find('.sidebar-sub-level-items li.active')).to have_content(title)
end end
end end
......
require 'spec_helper' require 'spec_helper'
describe 'Admin::Hooks' do describe 'Admin::Hooks', :js do
before do before do
@project = create(:project) @project = create(:project)
sign_in(create(:admin)) sign_in(create(:admin))
...@@ -12,7 +12,7 @@ describe 'Admin::Hooks' do ...@@ -12,7 +12,7 @@ describe 'Admin::Hooks' do
it 'is ok' do it 'is ok' do
visit admin_root_path visit admin_root_path
page.within '.layout-nav' do page.within '.nav-sidebar' do
click_on 'Hooks' click_on 'Hooks'
end end
......
...@@ -13,6 +13,8 @@ describe 'Issue Boards', js: true do ...@@ -13,6 +13,8 @@ describe 'Issue Boards', js: true do
project.team << [user, :master] project.team << [user, :master]
project.team << [user2, :master] project.team << [user2, :master]
allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true)
sign_in(user) sign_in(user)
end end
...@@ -145,6 +147,8 @@ describe 'Issue Boards', js: true do ...@@ -145,6 +147,8 @@ describe 'Issue Boards', js: true do
click_button 'Add list' click_button 'Add list'
wait_for_requests wait_for_requests
find('.dropdown-menu-close').click
page.within(find('.board:nth-child(2)')) do page.within(find('.board:nth-child(2)')) do
find('.board-delete').click find('.board-delete').click
end end
......
...@@ -7,9 +7,8 @@ RSpec.describe 'Dashboard Active Tab', js: true do ...@@ -7,9 +7,8 @@ RSpec.describe 'Dashboard Active Tab', js: true do
shared_examples 'page has active tab' do |title| shared_examples 'page has active tab' do |title|
it "#{title} tab" do it "#{title} tab" do
find('.global-dropdown-toggle').trigger('click') expect(page).to have_selector('.navbar-sub-nav li.active', count: 1)
expect(page).to have_selector('.global-dropdown-menu li.active', count: 1) expect(find('.navbar-sub-nav li.active')).to have_content(title)
expect(find('.global-dropdown-menu li.active')).to have_content(title)
end end
end end
...@@ -21,27 +20,19 @@ RSpec.describe 'Dashboard Active Tab', js: true do ...@@ -21,27 +20,19 @@ RSpec.describe 'Dashboard Active Tab', js: true do
it_behaves_like 'page has active tab', 'Projects' it_behaves_like 'page has active tab', 'Projects'
end end
context 'on dashboard issues' do context 'on dashboard groups' do
before do
visit issues_dashboard_path
end
it_behaves_like 'page has active tab', 'Issues'
end
context 'on dashboard merge requests' do
before do before do
visit merge_requests_dashboard_path visit dashboard_groups_path
end end
it_behaves_like 'page has active tab', 'Merge Requests' it_behaves_like 'page has active tab', 'Groups'
end end
context 'on dashboard groups' do context 'on activity projects' do
before do before do
visit dashboard_groups_path visit activity_dashboard_path
end end
it_behaves_like 'page has active tab', 'Groups' it_behaves_like 'page has active tab', 'Activity'
end end
end end
...@@ -50,7 +50,7 @@ feature 'Dashboard Issues filtering', :js do ...@@ -50,7 +50,7 @@ feature 'Dashboard Issues filtering', :js do
it 'updates atom feed link' do it 'updates atom feed link' do
visit_issues(milestone_title: '', assignee_id: user.id) 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) params = CGI.parse(URI.parse(link[:href]).query)
auto_discovery_link = find('link[type="application/atom+xml"]', visible: false) auto_discovery_link = find('link[type="application/atom+xml"]', visible: false)
auto_discovery_params = CGI.parse(URI.parse(auto_discovery_link[:href]).query) auto_discovery_params = CGI.parse(URI.parse(auto_discovery_link[:href]).query)
......
...@@ -50,6 +50,6 @@ feature 'Dashboard shortcuts', :js do ...@@ -50,6 +50,6 @@ feature 'Dashboard shortcuts', :js do
end end
def check_page_title(title) 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
end end
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
...@@ -65,14 +65,14 @@ feature 'Edit group settings' do ...@@ -65,14 +65,14 @@ feature 'Edit group settings' do
update_path(new_group_path) update_path(new_group_path)
visit new_project_full_path visit new_project_full_path
expect(current_path).to eq(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 end
scenario 'the old project path redirects to the new path' do scenario 'the old project path redirects to the new path' do
update_path(new_group_path) update_path(new_group_path)
visit old_project_full_path visit old_project_full_path
expect(current_path).to eq(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 end
end end
end end
......
...@@ -158,7 +158,7 @@ feature 'Group' do ...@@ -158,7 +158,7 @@ feature 'Group' do
expect(page).to have_content 'successfully updated' expect(page).to have_content 'successfully updated'
expect(find('#group_name').value).to eq(new_name) 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 expect(page).to have_content new_name
end end
end end
......
...@@ -89,6 +89,8 @@ describe 'Filter issues', js: true do ...@@ -89,6 +89,8 @@ describe 'Filter issues', js: true do
milestone: future_milestone, milestone: future_milestone,
project: project) project: project)
allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true)
visit project_issues_path(project) visit project_issues_path(project)
end end
...@@ -798,7 +800,7 @@ describe 'Filter issues', js: true do ...@@ -798,7 +800,7 @@ describe 'Filter issues', js: true do
it 'updates atom feed link for group issues' do it 'updates atom feed link for group issues' do
visit issues_group_path(group, milestone_title: milestone.title, assignee_id: user.id) 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) params = CGI.parse(URI.parse(link[:href]).query)
auto_discovery_link = find('link[type="application/atom+xml"]', visible: false) auto_discovery_link = find('link[type="application/atom+xml"]', visible: false)
auto_discovery_params = CGI.parse(URI.parse(auto_discovery_link[:href]).query) auto_discovery_params = CGI.parse(URI.parse(auto_discovery_link[:href]).query)
......
...@@ -28,6 +28,8 @@ describe 'Visual tokens', js: true do ...@@ -28,6 +28,8 @@ describe 'Visual tokens', js: true do
sign_in(user) sign_in(user)
create(:issue, project: project) create(:issue, project: project)
allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true)
visit project_issues_path(project) visit project_issues_path(project)
end end
......
...@@ -271,18 +271,22 @@ describe 'Issues' do ...@@ -271,18 +271,22 @@ describe 'Issues' do
it 'filters by none' do it 'filters by none' do
visit project_issues_path(project, due_date: Issue::NoDueDate.name) visit project_issues_path(project, due_date: Issue::NoDueDate.name)
page.within '.issues-holder' do
expect(page).not_to have_content('foo') expect(page).not_to have_content('foo')
expect(page).not_to have_content('bar') expect(page).not_to have_content('bar')
expect(page).to have_content('baz') expect(page).to have_content('baz')
end end
end
it 'filters by any' do it 'filters by any' do
visit project_issues_path(project, due_date: Issue::AnyDueDate.name) visit project_issues_path(project, due_date: Issue::AnyDueDate.name)
page.within '.issues-holder' do
expect(page).to have_content('foo') expect(page).to have_content('foo')
expect(page).to have_content('bar') expect(page).to have_content('bar')
expect(page).to have_content('baz') expect(page).to have_content('baz')
end end
end
it 'filters by due this week' do it 'filters by due this week' do
foo.update(due_date: Date.today.beginning_of_week + 2.days) foo.update(due_date: Date.today.beginning_of_week + 2.days)
...@@ -291,10 +295,12 @@ describe 'Issues' do ...@@ -291,10 +295,12 @@ describe 'Issues' do
visit project_issues_path(project, due_date: Issue::DueThisWeek.name) visit project_issues_path(project, due_date: Issue::DueThisWeek.name)
page.within '.issues-holder' do
expect(page).to have_content('foo') expect(page).to have_content('foo')
expect(page).to have_content('bar') expect(page).to have_content('bar')
expect(page).not_to have_content('baz') expect(page).not_to have_content('baz')
end end
end
it 'filters by due this month' do it 'filters by due this month' do
foo.update(due_date: Date.today.beginning_of_month + 2.days) foo.update(due_date: Date.today.beginning_of_month + 2.days)
...@@ -303,10 +309,12 @@ describe 'Issues' do ...@@ -303,10 +309,12 @@ describe 'Issues' do
visit project_issues_path(project, due_date: Issue::DueThisMonth.name) visit project_issues_path(project, due_date: Issue::DueThisMonth.name)
page.within '.issues-holder' do
expect(page).to have_content('foo') expect(page).to have_content('foo')
expect(page).to have_content('bar') expect(page).to have_content('bar')
expect(page).not_to have_content('baz') expect(page).not_to have_content('baz')
end end
end
it 'filters by overdue' do it 'filters by overdue' do
foo.update(due_date: Date.today + 2.days) foo.update(due_date: Date.today + 2.days)
...@@ -315,11 +323,13 @@ describe 'Issues' do ...@@ -315,11 +323,13 @@ describe 'Issues' do
visit project_issues_path(project, due_date: Issue::Overdue.name) visit project_issues_path(project, due_date: Issue::Overdue.name)
page.within '.issues-holder' do
expect(page).not_to have_content('foo') expect(page).not_to have_content('foo')
expect(page).not_to have_content('bar') expect(page).not_to have_content('bar')
expect(page).to have_content('baz') expect(page).to have_content('baz')
end end
end end
end
describe 'sorting by milestone' do describe 'sorting by milestone' do
before do before do
...@@ -567,7 +577,9 @@ describe 'Issues' do ...@@ -567,7 +577,9 @@ describe 'Issues' do
it 'redirects to signin then back to new issue after signin' do it 'redirects to signin then back to new issue after signin' do
visit project_issues_path(project) visit project_issues_path(project)
page.within '.breadcrumbs' do
click_link 'New issue' click_link 'New issue'
end
expect(current_path).to eq new_user_session_path expect(current_path).to eq new_user_session_path
......
...@@ -13,7 +13,9 @@ feature 'Create New Merge Request', js: true do ...@@ -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 it 'selects the source branch sha when a tag with the same name exists' do
visit project_merge_requests_path(project) visit project_merge_requests_path(project)
page.within '.content' do
click_link 'New merge request' click_link 'New merge request'
end
expect(page).to have_content('Source branch') expect(page).to have_content('Source branch')
expect(page).to have_content('Target branch') expect(page).to have_content('Target branch')
...@@ -26,7 +28,9 @@ feature 'Create New Merge Request', js: true do ...@@ -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 it 'selects the target branch sha when a tag with the same name exists' do
visit project_merge_requests_path(project) visit project_merge_requests_path(project)
page.within '.content' do
click_link 'New merge request' click_link 'New merge request'
end
expect(page).to have_content('Source branch') expect(page).to have_content('Source branch')
expect(page).to have_content('Target branch') expect(page).to have_content('Target branch')
...@@ -40,7 +44,9 @@ feature 'Create New Merge Request', js: true do ...@@ -40,7 +44,9 @@ feature 'Create New Merge Request', js: true do
it 'generates a diff for an orphaned branch' do it 'generates a diff for an orphaned branch' do
visit project_merge_requests_path(project) 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('Source branch')
expect(page).to have_content('Target branch') expect(page).to have_content('Target branch')
......
...@@ -21,6 +21,8 @@ feature 'Diff note avatars', js: true do ...@@ -21,6 +21,8 @@ feature 'Diff note avatars', js: true do
before do before do
project.team << [user, :master] project.team << [user, :master]
sign_in user sign_in user
allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true)
end end
context 'discussion tab' do context 'discussion tab' do
......
...@@ -88,7 +88,7 @@ feature 'Diffs URL', js: true do ...@@ -88,7 +88,7 @@ feature 'Diffs URL', js: true do
visit diffs_project_merge_request_path(project, merge_request) visit diffs_project_merge_request_path(project, merge_request)
# Throws `Capybara::Poltergeist::InvalidSelector` if we try to use `#hash` syntax # 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-fork-suggestion-button', count: 1)
expect(page).to have_selector('.js-cancel-fork-suggestion-button', count: 1) expect(page).to have_selector('.js-cancel-fork-suggestion-button', count: 1)
......
...@@ -6,6 +6,8 @@ feature 'Merge requests > User posts diff notes', :js do ...@@ -6,6 +6,8 @@ feature 'Merge requests > User posts diff notes', :js do
let(:project) { merge_request.source_project } let(:project) { merge_request.source_project }
before do before do
allow_any_instance_of(ApplicationHelper).to receive(:collapsed_sidebar?).and_return(true)
project.add_developer(user) project.add_developer(user)
sign_in(user) sign_in(user)
end end
......
...@@ -43,14 +43,14 @@ feature 'Profile > Account' do ...@@ -43,14 +43,14 @@ feature 'Profile > Account' do
update_username(new_username) update_username(new_username)
visit new_project_path visit new_project_path
expect(current_path).to eq(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 end
scenario 'the old project path redirects to the new path' do scenario 'the old project path redirects to the new path' do
update_username(new_username) update_username(new_username)
visit old_project_path visit old_project_path
expect(current_path).to eq(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 end
end end
end end
......
...@@ -13,8 +13,8 @@ describe 'Guest navigation menu' do ...@@ -13,8 +13,8 @@ describe 'Guest navigation menu' do
it 'shows allowed tabs only' do it 'shows allowed tabs only' do
visit project_path(project) visit project_path(project)
within('.layout-nav') do within('.nav-sidebar') do
expect(page).to have_content 'Project' expect(page).to have_content 'Overview'
expect(page).to have_content 'Issues' expect(page).to have_content 'Issues'
expect(page).to have_content 'Wiki' expect(page).to have_content 'Wiki'
......
require 'spec_helper' require 'spec_helper'
feature 'Projects > Members > User requests access' do feature 'Projects > Members > User requests access', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public, :access_requestable, :repository) } let(:project) { create(:project, :public, :access_requestable, :repository) }
let(:master) { project.owner } let(:master) { project.owner }
...@@ -46,11 +46,10 @@ feature 'Projects > Members > User requests access' do ...@@ -46,11 +46,10 @@ feature 'Projects > Members > User requests access' do
expect(project.requesters.exists?(user_id: user)).to be_truthy 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') click_link('Members')
end end
visit project_project_members_path(project)
page.within('.content') do page.within('.content') do
expect(page).not_to have_content(user.name) expect(page).not_to have_content(user.name)
end end
......
...@@ -46,7 +46,7 @@ describe 'Edit Project Settings' do ...@@ -46,7 +46,7 @@ describe 'Edit Project Settings' do
context 'when changing project name' do context 'when changing project name' do
it 'renames the repository' do it 'renames the repository' do
rename_project(project, name: 'bar') rename_project(project, name: 'bar')
expect(find('h1.title')).to have_content(project.name) expect(find('.breadcrumbs')).to have_content(project.name)
end end
context 'with emojis' do context 'with emojis' do
...@@ -74,7 +74,7 @@ describe 'Edit Project Settings' do ...@@ -74,7 +74,7 @@ describe 'Edit Project Settings' do
new_path = namespace_project_path(project.namespace, 'bar') new_path = namespace_project_path(project.namespace, 'bar')
visit new_path visit new_path
expect(current_path).to eq(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 end
specify 'the project is accessible via a redirect from the old path' do specify 'the project is accessible via a redirect from the old path' do
...@@ -83,7 +83,7 @@ describe 'Edit Project Settings' do ...@@ -83,7 +83,7 @@ describe 'Edit Project Settings' do
new_path = namespace_project_path(project.namespace, 'bar') new_path = namespace_project_path(project.namespace, 'bar')
visit old_path visit old_path
expect(current_path).to eq(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 end
context 'and a new project is added with the same path' do context 'and a new project is added with the same path' do
...@@ -93,7 +93,7 @@ describe 'Edit Project Settings' do ...@@ -93,7 +93,7 @@ describe 'Edit Project Settings' do
new_project = create(:project, namespace: user.namespace, path: 'gitlabhq', name: 'quz') new_project = create(:project, namespace: user.namespace, path: 'gitlabhq', name: 'quz')
visit old_path visit old_path
expect(current_path).to eq(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 end
end end
...@@ -120,7 +120,7 @@ describe 'Edit Project Settings' do ...@@ -120,7 +120,7 @@ describe 'Edit Project Settings' do
new_path = namespace_project_path(group, project) new_path = namespace_project_path(group, project)
visit new_path visit new_path
expect(current_path).to eq(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 end
specify 'the project is accessible via a redirect from the old path' do specify 'the project is accessible via a redirect from the old path' do
...@@ -129,7 +129,7 @@ describe 'Edit Project Settings' do ...@@ -129,7 +129,7 @@ describe 'Edit Project Settings' do
new_path = namespace_project_path(group, project) new_path = namespace_project_path(group, project)
visit old_path visit old_path
expect(current_path).to eq(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 end
context 'and a new project is added with the same path' do context 'and a new project is added with the same path' do
...@@ -139,7 +139,7 @@ describe 'Edit Project Settings' do ...@@ -139,7 +139,7 @@ describe 'Edit Project Settings' do
new_project = create(:project, namespace: user.namespace, path: 'gitlabhq', name: 'quz') new_project = create(:project, namespace: user.namespace, path: 'gitlabhq', name: 'quz')
visit old_path visit old_path
expect(current_path).to eq(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 end
end end
......
...@@ -24,7 +24,7 @@ describe 'Subgroup Issuables', :js, :nested_groups do ...@@ -24,7 +24,7 @@ describe 'Subgroup Issuables', :js, :nested_groups do
end end
def expect_to_have_full_subgroup_title def expect_to_have_full_subgroup_title
title = find('.title-container') title = find('.breadcrumbs-links')
expect(title).not_to have_selector '.initializing' expect(title).not_to have_selector '.initializing'
expect(title).to have_content 'group / subgroup / project' expect(title).to have_content 'group / subgroup / project'
......
...@@ -160,7 +160,7 @@ describe "Search" do ...@@ -160,7 +160,7 @@ describe "Search" do
fill_in 'search', with: 'gitlab' fill_in 'search', with: 'gitlab'
find('#search').native.send_keys(:enter) find('#search').native.send_keys(:enter)
page.within '.title' do page.within '.breadcrumbs-sub-title' do
expect(page).to have_content 'Search' expect(page).to have_content 'Search'
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment