mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-14 23:47:48 +00:00
Automatically select the customer's default card in the checkout
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
describe "PaymentCtrl", ->
|
||||
ctrl = null
|
||||
scope = null
|
||||
card1 = { id: 1, is_default: false }
|
||||
card2 = { id: 3, is_default: true }
|
||||
cards = [card1, card2]
|
||||
|
||||
beforeEach ->
|
||||
module("Darkswarm")
|
||||
angular.module('Darkswarm').value('savedCreditCards', cards)
|
||||
inject ($controller, $rootScope) ->
|
||||
scope = $rootScope.$new()
|
||||
scope.secrets = {}
|
||||
ctrl = $controller 'PaymentCtrl', {$scope: scope}
|
||||
|
||||
it "sets the default card id as the selected_card", ->
|
||||
expect(scope.secrets.selected_card).toEqual card2.id
|
||||
Reference in New Issue
Block a user