Skip to content

Commit

Permalink
Adding missing conditions from kcp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sponglord committed Nov 26, 2024
1 parent e863f37 commit 1612b83
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/e2e-playwright/tests/e2e/card/kcp/card.kcp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ test.describe('Card with KCP fields', () => {

await expect(cardWithKCP.paymentResult).toContainText(PAYMENT_RESULT.authorised);
});
test('should fill in KCP fields, then replace with non-korean Card and make a payment', async ({ cardWithKCP }) => {
test('should fill in KCP fields, then replace with non-korean Card and make a payment (seeing that kcp info has been cleared from card state)', async ({
cardWithKCP,
page
}) => {
await paymentSuccessfulMock(page);
const paymentsRequestPromise = page.waitForRequest(request => request.url().includes('/payments') && request.method() === 'POST');

await cardWithKCP.goto(URL_MAP.cardWithKcp);

await cardWithKCP.typeCardNumber(KOREAN_TEST_CARD);
Expand All @@ -75,6 +81,12 @@ test.describe('Card with KCP fields', () => {

await cardWithKCP.pay();

// Check that KCP fields are NOT passed in
const request = await paymentsRequestPromise;
const paymentMethod = await request.postDataJSON().paymentMethod;
expect(paymentMethod.encryptedPassword).toBeUndefined();
expect(paymentMethod.taxNumber).toBeUndefined();

await expect(cardWithKCP.paymentResult).toContainText(PAYMENT_RESULT.authorised);
});
});
Expand Down

0 comments on commit 1612b83

Please sign in to comment.