From feea844cd81068b501af929dace065957d6cb728 Mon Sep 17 00:00:00 2001 From: Robert Eldredge Date: Wed, 11 Aug 2021 15:16:45 -0400 Subject: [PATCH] add tests --- .../step-1/branded-checkout-step-1.spec.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/app/branded/step-1/branded-checkout-step-1.spec.js b/src/app/branded/step-1/branded-checkout-step-1.spec.js index f08f41e03..e81faa748 100644 --- a/src/app/branded/step-1/branded-checkout-step-1.spec.js +++ b/src/app/branded/step-1/branded-checkout-step-1.spec.js @@ -271,6 +271,29 @@ describe('branded checkout step 1', () => { }) }) + describe('onSelectPremiumOption', () => { + beforeEach(() => { + $ctrl.initItemConfig() + $ctrl.premiumCode = '112233' + }) + + it('premium selected', () => { + $ctrl.premiumSelected = true + + $ctrl.onSelectPremiumOption() + + expect($ctrl.itemConfig['premium-code']).toEqual($ctrl.premiumCode) + }) + + it('premium deselected', () => { + $ctrl.premiumSelected = false + + $ctrl.onSelectPremiumOption() + + expect($ctrl.itemConfig['premium-code']).toEqual(undefined) + }) + }) + describe('checkSuccessfulSubmission', () => { beforeEach(() => { $ctrl.resetSubmission()