Incrementally load products

This commit is contained in:
Rohan Mitchell
2014-11-21 12:44:59 +11:00
parent 001bf999d0
commit 0b030a85ff
7 changed files with 55 additions and 9 deletions

View File

@@ -7,6 +7,9 @@ describe "OverrideVariantsCtrl", ->
beforeEach ->
module 'ofn.admin'
module ($provide) ->
$provide.value 'SpreeApiKey', 'API_KEY'
null
scope = {}
inject ($controller, Indexer) ->
@@ -16,6 +19,13 @@ describe "OverrideVariantsCtrl", ->
expect(scope.hubs).toEqual hubs
expect(scope.hub).toBeNull
it "adds products", ->
expect(scope.products).toEqual []
scope.addProducts ['a', 'b']
expect(scope.products).toEqual ['a', 'b']
scope.addProducts ['c', 'd']
expect(scope.products).toEqual ['a', 'b', 'c', 'd']
describe "selecting a hub", ->
it "sets the chosen hub", ->
scope.hub_id = 1