Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook update, validation update, dep update #425

Merged
merged 4 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const CspHtmlWebpackPlugin = require('csp-html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer a part of react-dev-utils, not really that important given it's just dev config anyways

const eslintFormatter = require('react-dev-utils/eslintFormatter');
const getClientEnvironment = require('./env');
const paths = require('./paths');
Expand Down Expand Up @@ -313,7 +312,6 @@ module.exports = {
new webpack.DefinePlugin(env.stringified),
new webpack.HotModuleReplacementPlugin(),
new CaseSensitivePathsPlugin(),
new WatchMissingNodeModulesPlugin(paths.appNodeModules),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new ManifestPlugin({
fileName: 'asset-manifest.json',
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"dependencies": {
"@babel/polyfill": "^7.11.5",
"@comicrelief/storybook": "2.3.0",
"@snyk/protect": "^1.986.0",
"@comicrelief/storybook": "2.4.1",
"@snyk/protect": "1.1291.1",
"autoprefixer": "10.0.0",
"axios": "^1.6.8",
"browser-detect": "^0.2.28",
Expand All @@ -23,7 +23,7 @@
"raf": "3.4.0",
"raven-js": "^3.26.2",
"react": "^16.8.5",
"react-dev-utils": "^11.0.4",
"react-dev-utils": "^12.0.0",
"react-dom": "^16.8.5",
"react-gtm-module": "^2.0.2",
"react-meta-tags": "^0.7.4",
Expand Down
4 changes: 2 additions & 2 deletions playwright-local/tests/submit/addressValidation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ test.describe('Address validation', () => {

test('invalid postcodes should show error messages', async ({ page }) => {
await page.locator('input#field-input--postcode').fill('12SE17TP');
await expect(page.locator('div#field-error--postcode > span')).toHaveText('Please enter a valid UK postcode, using a space');
await expect(page.locator('div#field-error--postcode > span')).toHaveText('Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.');
await page.locator('input#field-input--postcode').fill('comic relief');
await expect(page.locator('div#field-error--postcode > span')).toHaveText('Please enter a valid UK postcode, using a space');
await expect(page.locator('div#field-error--postcode > span')).toHaveText('Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.');
await page.close();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test.describe('International addresses validation', () => {
await page.fill('input#field-input--postcode', '30916-395'); // Non-UK postcode

// Verify error message for UK postcode requirement
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space');
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.');

// Fill in address details
await page.click('a[aria-describedby=field-error--addressDetails]');
Expand Down
8 changes: 4 additions & 4 deletions playwright-local/tests/submit/postcodeLookup.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ test.describe('Postcode validation', () => {

test('Postcode formatting errors', async ({ page }) => {
const postcodes = [
{ code: 'S E 1 7 T P', message: 'Please enter a valid UK postcode, using a space' },
{ code: 'se17tp', message: 'Please enter a valid UK postcode, using a space' },
{ code: 'SE17TP', message: 'Please enter a valid UK postcode, using a space' },
{ code: 'SE$%TP', message: 'Please enter a valid UK postcode, using a space' }
{ code: 'S E 1 7 T P', message: 'Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.' },
{ code: 'se17tp', message: 'Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.' },
{ code: 'SE17TP', message: 'Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.' },
{ code: 'SE$%TP', message: 'Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.' }
];

for (const { code, message } of postcodes) {
Expand Down
8 changes: 4 additions & 4 deletions playwright-local/tests/update/formValidation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ test.describe('Giftaid update form validation', () => {

await page.locator('input#field-input--postcode').type('S E 1 7 T P');
await expect(page.locator('div#field-error--postcode > span')).toBeVisible();
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space');
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.');

await page.close();
});
Expand All @@ -208,7 +208,7 @@ test.describe('Giftaid update form validation', () => {

await page.locator('input#field-input--postcode').type('se17tp');
await expect(page.locator('div#field-error--postcode > span')).toBeVisible();
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space');
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.');

await page.close();
});
Expand All @@ -217,7 +217,7 @@ test.describe('Giftaid update form validation', () => {

await page.locator('input#field-input--postcode').type('SE17TP');
await expect(page.locator('div#field-error--postcode > span')).toBeVisible();
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space');
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.');

await page.close();
});
Expand All @@ -226,7 +226,7 @@ test.describe('Giftaid update form validation', () => {

await page.locator('input#field-input--postcode').type('SE$%TP');
await expect(page.locator('div#field-error--postcode > span')).toBeVisible();
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space');
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.');

await page.close();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test.describe('International addresses validation on update form', () => {

// enter a non-UK postcode and attempt to validate it
await page.locator('input#field-input--postcode').fill('30916-395');
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space');
await expect(page.locator('div#field-error--postcode > span')).toContainText('Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.');

// manually enter international address details
await page.locator('a[aria-describedby=field-error--addressDetails]').click();
Expand Down
Loading
Loading