diff --git a/app/assets/javascripts/supplier/app/components/button/close_list.js.coffee b/app/assets/javascripts/supplier/app/components/button/close_list.js.coffee index 27d8e89d..a7cabbf1 100644 --- a/app/assets/javascripts/supplier/app/components/button/close_list.js.coffee +++ b/app/assets/javascripts/supplier/app/components/button/close_list.js.coffee @@ -4,4 +4,4 @@ App.ButtonCloseListComponent = Ember.Component.extend classNameBindings: ['content.active:show:hide'] tagName: 'button' click: (e)-> - @get('targetObject').modal 'close_list', model: @get('content') + @modal 'close_list', model: @get('content') diff --git a/app/assets/javascripts/supplier/app/components/menu-product.js.coffee b/app/assets/javascripts/supplier/app/components/menu-product.js.coffee index b2b41d1f..1813bafe 100644 --- a/app/assets/javascripts/supplier/app/components/menu-product.js.coffee +++ b/app/assets/javascripts/supplier/app/components/menu-product.js.coffee @@ -32,7 +32,7 @@ App.MenuProductComponent = Ember.Component.extend if product.get('isNew') product.deleteRecord() else - @get('targetObject').modal 'confirm', + @modal 'confirm', model: product title_path: 'product.destroy_confirmation' ok: -> product.destroyRecord() diff --git a/app/assets/javascripts/supplier/app/components/section/area.js.coffee b/app/assets/javascripts/supplier/app/components/section/area.js.coffee index 1424d1c2..9a3bb342 100644 --- a/app/assets/javascripts/supplier/app/components/section/area.js.coffee +++ b/app/assets/javascripts/supplier/app/components/section/area.js.coffee @@ -29,6 +29,6 @@ App.SectionAreaComponent = Ember.Component.extend DragNDrop.Draggable, position_y: position.top / dpm click: -> return unless @get('targetObject.editmode') - @get('targetObject').modal 'section_area', + @modal 'section_area', title_path: 'section_area.modal.title' model: @get('section_area') diff --git a/app/assets/javascripts/supplier/app/modifications/component_modifications.js.coffee b/app/assets/javascripts/supplier/app/modifications/component_modifications.js.coffee new file mode 100644 index 00000000..fb5e1b28 --- /dev/null +++ b/app/assets/javascripts/supplier/app/modifications/component_modifications.js.coffee @@ -0,0 +1,6 @@ +ComponentExtensions = Ember.Mixin.create + modal: (name, options={})-> + target = App.__container__.lookup('route:application') + target.send "openModal", name, options + +Ember.Component.reopen ComponentExtensions diff --git a/spec/acceptance/suppliers/section_view.feature b/spec/acceptance/suppliers/section_view.feature index 18696766..b2077842 100644 --- a/spec/acceptance/suppliers/section_view.feature +++ b/spec/acceptance/suppliers/section_view.feature @@ -30,9 +30,11 @@ Feature: Supplier section view When the list is marked as in need of payment Then the section table should be marked as in need of payment - And I wait 0.5 seconds + And I wait 1 seconds - When I click on the close list button in the section table table popup + # Reopen the table menu + When I click on section table as a supplier + And I click on the close list button in the section table table popup And confirm the supplier close list modal And I wait 1 second Then the section table should not have any active list markings anymore diff --git a/spec/acceptance_steps/suppliers/section_view_steps.rb b/spec/acceptance_steps/suppliers/section_view_steps.rb index 5fe77320..0ea50af5 100644 --- a/spec/acceptance_steps/suppliers/section_view_steps.rb +++ b/spec/acceptance_steps/suppliers/section_view_steps.rb @@ -59,10 +59,9 @@ end step "I click on the close list button in the section table table popup" do # first click on the table to open the table actions popup - table = page.find(".section-table-#{@table.id}") - table.click + #table = page.find(".section-table-#{@table.id}") # now click the close list button inside the table actions popup - page.find(".section-table-#{@table.id} .table-actions .close-list-button").click + js_click ".section-table-#{@table.id} .table-actions .close-list-button" end step "the section table should not have any active list markings anymore" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4b17c820..009da96a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -23,7 +23,7 @@ Devise.stretches = 1 #Capybara.javascript_driver = :webkit #Capybara.javascript_driver = :poltergeist Capybara.javascript_driver = :selenium -Capybara.default_wait_time = 3 # ember needs more time than the default of 2 +Capybara.default_wait_time = 5 # ember needs more time than the default of 2 Capybara::Screenshot.webkit_options = { width: 1024, height: 768 } WebMock.disable_net_connect!(allow_localhost: true)