Skip to content

Commit

Permalink
Merge branch 'v6' into v6-dependencies-update
Browse files Browse the repository at this point in the history
  • Loading branch information
ribeiroguilherme committed Apr 30, 2024
2 parents 2bdaeff + 147b94a commit 617627f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test('#1 Enter number of unsupported card, ' + 'then check UI shows an error ' +
await cardPage.cardUtils.fillCardNumber(t, REGULAR_TEST_CARD, 'paste');

// Test UI shows "Unsupported card" error has gone
await t.expect(cardPage.numErrorText.exists).notOk();
await t.expect(cardPage.numErrorText.withExactText('').exists).ok();
});

test(
Expand Down Expand Up @@ -77,7 +77,7 @@ test(
await cardPage.cardUtils.fillCardNumber(t, REGULAR_TEST_CARD, 'paste');

// Test UI shows "Unsupported card" error has gone
await t.expect(cardPage.numErrorText.exists).notOk();
await t.expect(cardPage.numErrorText.withExactText('').exists).ok();

// PAN error cleared but other errors persist
await t
Expand Down Expand Up @@ -109,7 +109,7 @@ test('#3 Enter number of unsupported card, ' + 'then check UI shows an error ' +
await cardPage.cardUtils.fillCardNumber(t, UNKNOWN_VISA_CARD, 'paste');

// Test UI shows "Unsupported card" error has gone
await t.expect(cardPage.numErrorText.exists).notOk();
await t.expect(cardPage.numErrorText.withExactText('').exists).ok();
});

test('#4 Enter number of unsupported card, ' + 'then check UI shows an error ' + 'then delete PAN & check UI error is cleared', async t => {
Expand All @@ -131,5 +131,5 @@ test('#4 Enter number of unsupported card, ' + 'then check UI shows an error ' +
await cardPage.cardUtils.deleteCardNumber(t);

// Test UI shows "Unsupported card" error has gone
await t.expect(cardPage.numErrorText.exists).notOk();
await t.expect(cardPage.numErrorText.withExactText('').exists).ok();
});
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test('#2 Click pay with empty fields and error panel in avsCard is populated', a
.ok()
.expect(cardPage.errorPanelEls.nth(2).withExactText(CVC_EMPTY).exists)
.ok()
.expect(cardPage.errorPanelEls.nth(3).withExactText(`Enter the Country${SR_INDICATOR_PREFIX}`).exists)
.expect(cardPage.errorPanelEls.nth(3).withExactText(`Enter the Country/Region${SR_INDICATOR_PREFIX}`).exists)
.ok()
.expect(cardPage.errorPanelEls.nth(4).withExactText(`Enter the Street${SR_INDICATOR_PREFIX}`).exists)
.ok()
Expand Down Expand Up @@ -98,7 +98,7 @@ test('#3 fill out credit card fields & see that first error in error panel is co

// Expect 5 elements, with default order & text
await t
.expect(cardPage.errorPanelEls.nth(0).withExactText(`Enter the Country${SR_INDICATOR_PREFIX}`).exists)
.expect(cardPage.errorPanelEls.nth(0).withExactText(`Enter the Country/Region${SR_INDICATOR_PREFIX}`).exists)
.ok()
.expect(cardPage.errorPanelEls.nth(1).withExactText(`Enter the Street${SR_INDICATOR_PREFIX}`).exists)
.ok()
Expand Down
10 changes: 5 additions & 5 deletions packages/e2e/tests/cards/expiryDate/minimumExpiryDate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ test('#3 With minimumExpiryDate set - input an expiry date that is matches it &
await t.expect(errorHolder.exists).notOk();

// Test UI shows no error
await t.expect(errorLabel.exists).notOk();
await t.expect(errorLabel.withExactText('').exists).ok();
});

test('#4 With minimumExpiryDate set - input an expiry date that exceeds it (a bit) & expect no error', async t => {
Expand All @@ -84,7 +84,7 @@ test('#4 With minimumExpiryDate set - input an expiry date that exceeds it (a bi
await t.expect(errorHolder.exists).notOk();

// Test UI shows no error
await t.expect(errorLabel.exists).notOk();
await t.expect(errorLabel.withExactText('').exists).ok();
});

test('#5 With minimumExpiryDate set - input an expiry date that is too far in the future, & expect the correct error ', async t => {
Expand Down Expand Up @@ -120,7 +120,7 @@ test(
await t.expect(errorHolder.exists).notOk();

// Test UI shows no error
await t.expect(errorLabel.exists).notOk();
await t.expect(errorLabel.withExactText('').exists).ok();

// Card out of date
await cardUtils.fillDate(t, '08/24', 'paste');
Expand All @@ -139,7 +139,7 @@ test(
);

test(
'General "date edit" bug: input a valid expiry date & expect no error ' +
'#7 General "date edit" bug: input a valid expiry date & expect no error ' +
'then edit the date to be before invalid and expect that to immediately register as an error',
async t => {
// Start, allow time for iframes to load
Expand All @@ -152,7 +152,7 @@ test(
await t.expect(errorHolder.exists).notOk();

// Test UI shows no error
await t.expect(errorLabel.exists).notOk();
await t.expect(errorLabel.withExactText('').exists).ok();

// Card out of date
await cardUtils.fillDate(t, '04/10', 'paste');
Expand Down
3 changes: 1 addition & 2 deletions packages/playground/src/pages/Cards/Cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ getPaymentMethods({ amount, shopperLocale }).then(async paymentMethodsResponse =
preselectedValue: 4
}
},
disclaimerMessage,
showBrandsUnderCardNumber: true,
showInstallmentAmounts: true,
disclaimerMessage,
onError: obj => {
console.log('### Cards::onError:: obj=', obj);
},
Expand Down

0 comments on commit 617627f

Please sign in to comment.