Fix group by specs

pull/6245/head
Oliver Günther 7 years ago
parent 7cc1d00adc
commit 424ca5f579
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 1
      frontend/app/components/wp-table/configuration-modal/tab-portal-outlet.ts
  2. 2
      frontend/app/components/wp-table/configuration-modal/wp-table-configuration.modal.html
  3. 5
      spec/features/work_packages/table/group_by/group_headers_spec.rb
  4. 4
      spec/support/components/work_packages/group_by.rb
  5. 6
      spec/support/components/work_packages/table_configuration_modal.rb

@ -50,6 +50,7 @@ export class TabPortalOutlet {
public switchTo(name:string) {
const tab = _.find(this.availableTabs, tab => tab.name === name);
if (!tab) {
throw(`Trying to swtich to unknown tab ${name}.`);
}

@ -20,7 +20,7 @@
href="#"
[ngClass]="{ 'selected': currentTab && tab.name === currentTab.name }"
[textContent]="tab.title"
(click)="switchTo(tab)">
(click)="switchTo(tab.name)">
</a>
</ul>
<div class="tabs-buttons" style="display:none;">

@ -11,6 +11,7 @@ describe 'Work Package table group headers', js: true do
let!(:wp_cat2) { FactoryGirl.create(:work_package, project: project, category: category2) }
let!(:wp_none) { FactoryGirl.create(:work_package, project: project) }
let(:wp_table) { Pages::WorkPackagesTable.new(project) }
let(:group_by) { ::Components::WorkPackages::GroupBy.new }
let!(:query) do
query = FactoryGirl.build(:query, user: user, project: project)
@ -32,9 +33,7 @@ describe 'Work Package table group headers', js: true do
it 'shows group headers for group by category' do
# Group by category
wp_table.click_setting_item 'Group by ...'
select 'Category', from: 'selected_columns_new'
click_button 'Apply'
group_by.enable_via_menu 'Category'
# Expect table to be grouped as WP created above
expect(page).to have_selector('.group--value .count', count: 3)

@ -43,14 +43,14 @@ module Components
def enable_via_menu(name)
modal = TableConfigurationModal.new
modal.open_and_set_display_mode 'Grouped mode'
modal.open_and_set_display_mode 'grouped'
select name, from: 'selected_grouping'
modal.save
end
def disable_via_menu
modal = TableConfigurationModal.new
modal.open_and_set_display_mode 'Default mode'
modal.open_and_set_display_mode 'default'
modal.save
end

@ -34,11 +34,11 @@ module Components
def open_and_switch_to(name)
open!
switch(name)
switch_to(name)
end
def open_and_set_display_mode(mode)
open_and_switch_to 'Group by'
open_and_switch_to 'Display settings'
choose("display_mode_switch", option: mode)
end
@ -59,7 +59,7 @@ module Components
expect(page).to have_no_selector(selector)
end
def switch(target)
def switch_to(target)
find("#{selector} .tab-show", text: target).click
end

Loading…
Cancel
Save