Fix various import issues: currentHub

This commit is contained in:
Jean-Baptiste Bellet
2023-02-03 16:25:13 +01:00
parent 292338d467
commit a486a08bfc
3 changed files with 13 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ describe 'ProductsCtrl', ->
Cart = {}
Taxons = null
Properties = null
currentHub = null
beforeEach ->
module('Darkswarm')
@@ -19,10 +20,12 @@ describe 'ProductsCtrl', ->
Taxons:
taxons: []
Properties: {}
currentHub =
id: 1
inject ($rootScope, $controller) ->
scope = $rootScope
ctrl = $controller 'ProductsCtrl', {$scope: scope, Products: Products, OrderCycle: OrderCycle, Cart: Cart, Taxons: Taxons, Properties: Properties}
ctrl = $controller 'ProductsCtrl', {$scope: scope, Products: Products, OrderCycle: OrderCycle, Cart: Cart, Taxons: Taxons, Properties: Properties, currentHub: currentHub}
it 'fetches products from Products', ->
expect(scope.Products.products).toEqual ['testy mctest']

View File

@@ -3,6 +3,7 @@ describe 'Checkout service', ->
notify: (arg) ->
Checkout = null
orderData = null
currentHub = null
$httpBackend = null
Navigation = null
navigationSpy = null
@@ -49,6 +50,9 @@ describe 'Checkout service', ->
lastname: "Harrington"
ship_address: {test: "bar"}
user_id: 901
currentHub =
hub:
id: 99
window.Bugsnag = BugsnagMock
@@ -58,6 +62,7 @@ describe 'Checkout service', ->
$provide.value "Loading", Loading
$provide.value "currentOrder", orderData
$provide.value "shippingMethods", shippingMethods
$provide.value "currentHub", currentHub
$provide.value "paymentMethods", paymentMethods
$provide.value "StripeInstancePublishableKey", "instance_publishable_key"
null

View File

@@ -8,6 +8,7 @@ describe 'Products service', ->
Cart = null
shopfront = null
currentOrder = null
currentHub = null
product = null
productWithImage = null
properties = null
@@ -33,6 +34,8 @@ describe 'Products service', ->
]
currentOrder =
line_items: []
currentHub =
id: 1
properties =
{ id: 1, name: "some property" }
taxons =
@@ -51,6 +54,7 @@ describe 'Products service', ->
module ($provide)->
$provide.value "shopfront", shopfront
$provide.value "currentOrder", currentOrder
$provide.value "currentHub", currentHub
$provide.value "taxons", taxons
$provide.value "properties", properties
$provide.value "GmapsGeo", GmapsGeo