Skip to content

Commit

Permalink
Added another unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sponglord committed Feb 9, 2024
1 parent cd5ffa1 commit 43aa025
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/lib/src/components/Dropin/Dropin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,14 @@ describe('Dropin', () => {
});

describe('Complying with local regulations', () => {
test('when countryCode is Finland openFirstPaymentMethod & openFirstStoredPaymentMethod should be false', async () => {
test('Default values for openFirstPaymentMethod & openFirstStoredPaymentMethod are true', () => {
const dropin = new Dropin(checkout);

expect(dropin.props.openFirstPaymentMethod).toBe(true);
expect(dropin.props.openFirstStoredPaymentMethod).toBe(true);
});

test('when countryCode is Finland openFirstPaymentMethod & openFirstStoredPaymentMethod should be false by default', () => {
checkout.options.countryCode = 'FI';

const dropin = new Dropin(checkout);
Expand All @@ -168,7 +175,7 @@ describe('Dropin', () => {
expect(dropin.props.openFirstStoredPaymentMethod).toBe(false);
});

test('if openFirstPaymentMethod & openFirstStoredPaymentMethod are set by merchant then these values should be used', async () => {
test('if openFirstPaymentMethod & openFirstStoredPaymentMethod are set by merchant then these values should be used', () => {
checkout.options.countryCode = 'FI';

const dropin = new Dropin(checkout, { openFirstPaymentMethod: true, openFirstStoredPaymentMethod: true });
Expand Down

0 comments on commit 43aa025

Please sign in to comment.