Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into chore/revert_always_make_analytic…
Browse files Browse the repository at this point in the history
…s_setup_call
  • Loading branch information
sponglord committed Aug 23, 2024
2 parents 14fedcb + 3dba164 commit ab925d8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 30 deletions.
58 changes: 29 additions & 29 deletions packages/e2e-playwright/tests/issuerList/issuer-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,42 +38,42 @@ test.describe('Issuer List', () => {
await expect(issuerList.submitButton).toHaveText('Continue to Nest Bank');
});

test('it should have the expected data in state, ready for the /payments call', async ({ issuerListPage }) => {
const { issuerList, page } = issuerListPage;
// test('it should have the expected data in state, ready for the /payments call', async ({ issuerListPage }) => {
// const { issuerList, page } = issuerListPage;

// Open the drop down and select an item
await issuerList.clickOnSelector();
await pressKeyboardToNextItem(page); // Arrow down
await pressKeyboardToSelectItem(page); // Enter key
// // Open the drop down and select an item
// await issuerList.clickOnSelector();
// await pressKeyboardToNextItem(page); // Arrow down
// await pressKeyboardToSelectItem(page); // Enter key

let issuerListData = await page.evaluate('window.dotpay.data');
// let issuerListData = await page.evaluate('window.dotpay.data');

// @ts-ignore
expect(issuerListData.paymentMethod).toEqual({
type: 'dotpay',
issuer: '73',
checkoutAttemptId: 'do-not-track'
});
});
// // @ts-ignore
// expect(issuerListData.paymentMethod).toEqual({
// type: 'dotpay',
// issuer: '73',
// checkoutAttemptId: 'do-not-track'
// });
// });

test('should select highlighted issuer, update pay button label, and see the expected data in state', async ({ issuerListPage }) => {
const { issuerList, page } = issuerListPage;
// test('should select highlighted issuer, update pay button label, and see the expected data in state', async ({ issuerListPage }) => {
// const { issuerList, page } = issuerListPage;

await issuerList.selectHighlightedIssuer('BLIK');
await expect(issuerList.submitButton).toHaveText('Continue to BLIK');
// await issuerList.selectHighlightedIssuer('BLIK');
// await expect(issuerList.submitButton).toHaveText('Continue to BLIK');

await issuerList.selectHighlightedIssuer('Idea Cloud');
await expect(issuerList.submitButton).toHaveText('Continue to Idea Cloud');
// await issuerList.selectHighlightedIssuer('Idea Cloud');
// await expect(issuerList.submitButton).toHaveText('Continue to Idea Cloud');

await expect(issuerList.highlightedIssuerButtonGroup.getByRole('button', { pressed: true })).toHaveText('Idea Cloud');
// await expect(issuerList.highlightedIssuerButtonGroup.getByRole('button', { pressed: true })).toHaveText('Idea Cloud');

let issuerListData = await page.evaluate('window.dotpay.data');
// let issuerListData = await page.evaluate('window.dotpay.data');

// @ts-ignore
expect(issuerListData.paymentMethod).toEqual({
type: 'dotpay',
issuer: '81',
checkoutAttemptId: 'do-not-track'
});
});
// // @ts-ignore
// expect(issuerListData.paymentMethod).toEqual({
// type: 'dotpay',
// issuer: '81',
// checkoutAttemptId: 'do-not-track'
// });
// });
});
16 changes: 15 additions & 1 deletion packages/lib/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as path from 'path';
import stylelint from 'vite-plugin-stylelint';
import generateEnvironmentVariables from '../config/environment-variables';
import { resolve } from 'node:path';
import * as dotenv from 'dotenv';
dotenv.config({ path: resolve('../../', '.env') });

const config: StorybookConfig = {
stories: ['../storybook/**/*.stories.@(js|jsx|ts|tsx)'],
Expand All @@ -29,6 +31,10 @@ const config: StorybookConfig = {
staticDirs: ['../storybook/assets'],

viteFinal(config) {
const isHttps = process.env.IS_HTTPS === 'true';
const cert = process.env.CERT_PATH ?? resolve(__dirname, 'localhost.pem');
const key = process.env.CERT_KEY_PATH ?? resolve(__dirname, 'localhost-key.pem');

return mergeConfig(config, {
define: generateEnvironmentVariables(),
resolve: {
Expand All @@ -42,7 +48,15 @@ const config: StorybookConfig = {
]
},
server: {
hmr: true,
...(isHttps && {
https: {
key,
cert
}
}),
hmr: {
protocol: isHttps ? 'wss' : 'ws'
},
watch: {
usePolling: true
}
Expand Down

0 comments on commit ab925d8

Please sign in to comment.