Client side table management for supplier sections

This commit is contained in:
2015-08-14 19:02:39 +02:00
parent 9ca5190c6a
commit 5d02f5d37b
13 changed files with 191 additions and 39 deletions
@@ -1,8 +1,10 @@
#module "suppliers-switcher", "SuppliersSwitcherComponent"
moduleForComponent "suppliers-switcher"
test "Triggers switch", ->
expect 2
component = @subject()
controller = App.__container__.lookup('controller:settings')
component.set 'targetObject', controller
Ember.run ->
controller.store.createRecord 'supplier',
id: 'other-supplier'
@@ -11,11 +13,8 @@ test "Triggers switch", ->
@render()
equal find('ul').text(), "Switch to Other supplier1"
s_name = null
# Stub the action, since it triggers an external call
component._actions.switchTo = (supplier)->
s_name = supplier.get('name')
equal supplier.get('name'), 'Other supplier1'
click 'li a'
equal s_name, 'Other supplier1'