Commit 4a67699e authored by Phil Hughes's avatar Phil Hughes

spec updates

parent d0d918c7
...@@ -145,6 +145,8 @@ describe 'Issue Boards', js: true do ...@@ -145,6 +145,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
......
...@@ -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)
......
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
......
...@@ -271,17 +271,21 @@ describe 'Issues' do ...@@ -271,17 +271,21 @@ 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)
expect(page).not_to have_content('foo') page.within '.issues-holder' do
expect(page).not_to have_content('bar') expect(page).not_to have_content('foo')
expect(page).to have_content('baz') expect(page).not_to have_content('bar')
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)
expect(page).to have_content('foo') page.within '.issues-holder' do
expect(page).to have_content('bar') expect(page).to have_content('foo')
expect(page).to have_content('baz') expect(page).to have_content('bar')
expect(page).to have_content('baz')
end
end end
it 'filters by due this week' do it 'filters by due this week' do
...@@ -291,9 +295,11 @@ describe 'Issues' do ...@@ -291,9 +295,11 @@ describe 'Issues' do
visit project_issues_path(project, due_date: Issue::DueThisWeek.name) visit project_issues_path(project, due_date: Issue::DueThisWeek.name)
expect(page).to have_content('foo') page.within '.issues-holder' do
expect(page).to have_content('bar') expect(page).to have_content('foo')
expect(page).not_to have_content('baz') expect(page).to have_content('bar')
expect(page).not_to have_content('baz')
end
end end
it 'filters by due this month' do it 'filters by due this month' do
...@@ -303,9 +309,11 @@ describe 'Issues' do ...@@ -303,9 +309,11 @@ describe 'Issues' do
visit project_issues_path(project, due_date: Issue::DueThisMonth.name) visit project_issues_path(project, due_date: Issue::DueThisMonth.name)
expect(page).to have_content('foo') page.within '.issues-holder' do
expect(page).to have_content('bar') expect(page).to have_content('foo')
expect(page).not_to have_content('baz') expect(page).to have_content('bar')
expect(page).not_to have_content('baz')
end
end end
it 'filters by overdue' do it 'filters by overdue' do
...@@ -315,9 +323,11 @@ describe 'Issues' do ...@@ -315,9 +323,11 @@ describe 'Issues' do
visit project_issues_path(project, due_date: Issue::Overdue.name) visit project_issues_path(project, due_date: Issue::Overdue.name)
expect(page).not_to have_content('foo') page.within '.issues-holder' do
expect(page).not_to have_content('bar') expect(page).not_to have_content('foo')
expect(page).to have_content('baz') expect(page).not_to have_content('bar')
expect(page).to have_content('baz')
end
end end
end end
......
...@@ -13,7 +13,7 @@ describe 'Guest navigation menu' do ...@@ -13,7 +13,7 @@ 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 'Project'
expect(page).to have_content 'Issues' expect(page).to have_content 'Issues'
expect(page).to have_content 'Wiki' expect(page).to have_content 'Wiki'
......
...@@ -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'
......
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