From e29d6048c25d49d20a505c7b7d9989d3a07f7220 Mon Sep 17 00:00:00 2001 From: Cillian O'Ruanaidh Date: Fri, 23 Oct 2020 10:53:30 +0100 Subject: [PATCH] Add a test for sorting admin products by name --- .../unit/admin/bulk_product_update_spec.js.coffee | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/javascripts/unit/admin/bulk_product_update_spec.js.coffee b/spec/javascripts/unit/admin/bulk_product_update_spec.js.coffee index f7e7fd45b4..1783cfc957 100644 --- a/spec/javascripts/unit/admin/bulk_product_update_spec.js.coffee +++ b/spec/javascripts/unit/admin/bulk_product_update_spec.js.coffee @@ -357,6 +357,15 @@ describe "AdminProductEditCtrl", -> it "resets dirtyProducts", -> expect(DirtyProducts.clear).toHaveBeenCalled() + describe "sorting products", -> + it "sorts products", -> + spyOn $scope, "fetchProducts" + + $scope.sortOptions.toggle('name') + $scope.$apply() + + expect($scope.q.sorting).toEqual 'name asc' + expect($scope.fetchProducts).toHaveBeenCalled() describe "updating the product on hand count", -> it "updates when product is not available on demand", ->