provide default availableUnits to specs

This commit is contained in:
Andy Brett
2020-10-08 08:59:24 -07:00
parent 67a603f77f
commit 9bf84bd5a8
5 changed files with 19 additions and 0 deletions

View File

@@ -257,6 +257,10 @@ describe "AdminProductEditCtrl", ->
$provide.value 'SpreeApiKey', 'API_KEY'
$provide.value 'columns', []
null
module "admin.products"
module ($provide)->
$provide.value "availableUnits", "g,kg,T,mL,L,kL"
null
beforeEach inject((_$controller_, _$timeout_, $rootScope, _$httpBackend_, _BulkProducts_, _DirtyProducts_, _DisplayProperties_, _ProductFiltersUrl_) ->
$scope = $rootScope.$new()

View File

@@ -7,6 +7,10 @@ describe "LineItemsCtrl", ->
module ($provide) ->
$provide.value 'columns', []
null
module "admin.products"
module ($provide)->
$provide.value "availableUnits", "g,kg,T,mL,L,kL"
null
jasmine.addMatchers
toDeepEqual: (util, customEqualityTesters) ->

View File

@@ -3,6 +3,9 @@ describe "OptionValueNamer", ->
beforeEach ->
module('admin.products')
module ($provide)->
$provide.value "availableUnits", "g,kg,T,mL,L,kL"
null
inject (_OptionValueNamer_) ->
subject = new _OptionValueNamer_

View File

@@ -5,10 +5,14 @@ describe "unitsCtrl", ->
beforeEach ->
module('admin.products')
module ($provide)->
$provide.value "availableUnits", "g,kg,T,mL,L,kL"
null
inject ($rootScope, $controller, VariantUnitManager) ->
scope = $rootScope
ctrl = $controller 'unitsCtrl', {$scope: scope, VariantUnitManager: VariantUnitManager}
describe "interpretting variant_unit_with_scale", ->
it "splits string with one underscore and stores the two parts", ->
scope.product.variant_unit_with_scale = "weight_1000"

View File

@@ -3,6 +3,10 @@ describe "Option Value Namer", ->
beforeEach ->
module "ofn.admin"
module "admin.products"
module ($provide)->
$provide.value "availableUnits", "g,kg,T,mL,L,kL"
null
beforeEach inject (_OptionValueNamer_) ->
OptionValueNamer = _OptionValueNamer_