Rewrite removed frontend tests with feature specs (#4350)
This PR adds two feature specs: Replacement for work-packages-modal-focus-spec.js Replacement for parent-relations-handler-spec.js The remainig tests removed with #4346 are already covered as follows: activity-with-revisions-spec.js (covered by activity_comments_spec.rb) details-pane-editable-spec.js (covered by edit_work_package_spec.rb) details-pane-show-hide-accessibility-spec.js (obsolete) details-pane-spec.js (covered by several feature specs)pull/4355/head
parent
23ac3192ff
commit
21842335ac
@ -0,0 +1,59 @@ |
||||
require 'spec_helper' |
||||
|
||||
describe 'Work package relations tab', js: true, selenium: true do |
||||
let(:user) { FactoryGirl.create :admin } |
||||
let(:work_package) { FactoryGirl.create(:work_package) } |
||||
let(:work_packages_page) { ::Pages::SplitWorkPackage.new(work_package) } |
||||
|
||||
before do |
||||
login_as user |
||||
|
||||
work_packages_page.visit_tab!('relations') |
||||
loading_indicator_saveguard |
||||
work_packages_page.expect_subject |
||||
end |
||||
|
||||
describe 'no relations' do |
||||
it 'shows empty relation tabs' do |
||||
%w(parent children relates duplicates |
||||
duplicated blocks blocked precedes follows).each do |rel| |
||||
within ".relation.#{rel}" do |
||||
find(".#{rel}-toggle-link").click |
||||
expect(page).to have_selector('.content', text: 'No relation exists') |
||||
end |
||||
end |
||||
end |
||||
end |
||||
|
||||
describe 'with parent' do |
||||
let(:parent) { FactoryGirl.create(:work_package) } |
||||
let(:work_package) { FactoryGirl.create(:work_package, parent: parent) } |
||||
|
||||
it 'shows the parent relationship expanded' do |
||||
within '.relation.parent' do |
||||
expect(page).to have_selector('.content', text: "##{parent.id} #{parent.subject}") |
||||
end |
||||
end |
||||
end |
||||
|
||||
describe 'create parent relationship' do |
||||
let(:parent) { FactoryGirl.create(:work_package) } |
||||
let(:work_package) { FactoryGirl.create(:work_package) } |
||||
|
||||
include_context 'ui-select helpers' |
||||
|
||||
it 'shows the parent relationship expanded' do |
||||
within '.relation.parent' do |
||||
# Expand parent |
||||
find('.parent-toggle-link').click |
||||
|
||||
form = find('.choice--select') |
||||
ui_select_choose(form, parent.id) |
||||
|
||||
click_button 'Change parent' |
||||
|
||||
expect(page).to have_selector('.content', text: "##{parent.id} #{parent.subject}") |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,53 @@ |
||||
require 'spec_helper' |
||||
|
||||
describe 'Modal focus in work package table', js: true do |
||||
let(:user) { FactoryGirl.create :admin } |
||||
|
||||
let!(:project) { FactoryGirl.create(:project) } |
||||
let!(:work_package) { FactoryGirl.create(:work_package, project: project) } |
||||
let(:wp_table) { ::Pages::WorkPackagesTable.new(project) } |
||||
|
||||
before do |
||||
login_as user |
||||
|
||||
wp_table.visit! |
||||
loading_indicator_saveguard |
||||
find('#work-packages-settings-button').click |
||||
end |
||||
|
||||
describe 'columns' do |
||||
it 'sets the focus in the colum selection' do |
||||
within '#settingsDropdown' do |
||||
click_link 'Columns' |
||||
end |
||||
|
||||
loading_indicator_saveguard |
||||
expect(page).to have_selector('.ng-modal-window h3', text: 'Columns') |
||||
expect(page).to have_focus_on('#selected_columns .select2-input') |
||||
end |
||||
end |
||||
|
||||
describe 'sorting' do |
||||
it 'sets the focus in the sort selection' do |
||||
within '#settingsDropdown' do |
||||
click_link 'Sort by' |
||||
end |
||||
|
||||
loading_indicator_saveguard |
||||
expect(page).to have_selector('.ng-modal-window h3', text: 'Sorting') |
||||
expect(page).to have_focus_on('#modal-sorting-attribute-0') |
||||
end |
||||
end |
||||
|
||||
describe 'group by' do |
||||
it 'sets the focus in the sort selection' do |
||||
within '#settingsDropdown' do |
||||
click_link 'Group by' |
||||
end |
||||
|
||||
loading_indicator_saveguard |
||||
expect(page).to have_selector('.ng-modal-window h3', text: 'Group by') |
||||
expect(page).to have_focus_on('#selected_columns_new') |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue