mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Add spec to cover orders_controller watch sortOptions
This commit is contained in:
@@ -20,7 +20,6 @@ describe "CustomersCtrl", ->
|
||||
{id: 109, name: "Australia", states: [{id: 55, name: "ACT", abbr: "ACT"}]}
|
||||
]
|
||||
|
||||
|
||||
inject ($controller, $rootScope, _CustomerResource_, $httpBackend) ->
|
||||
scope = $rootScope
|
||||
http = $httpBackend
|
||||
|
||||
@@ -36,9 +36,18 @@ describe "ordersCtrl", ->
|
||||
'q[s]': 'completed_at desc'
|
||||
}))
|
||||
|
||||
|
||||
describe "using pagination", ->
|
||||
it "changes the page", ->
|
||||
$scope.changePage(2)
|
||||
expect($scope.page).toEqual 2
|
||||
expect(Orders.index).toHaveBeenCalled()
|
||||
|
||||
describe "sorting products", ->
|
||||
it "sorts orders", ->
|
||||
spyOn $scope, "fetchResults"
|
||||
|
||||
$scope.sortOptions.toggle('number')
|
||||
$scope.$apply()
|
||||
|
||||
expect($scope.sorting).toEqual 'number asc'
|
||||
expect($scope.fetchResults).toHaveBeenCalled()
|
||||
|
||||
Reference in New Issue
Block a user