Skip to content

Commit d3169f4

Browse files
CCM-12065: Update error wording
1 parent 1731c50 commit d3169f4

File tree

10 files changed

+14
-36
lines changed

10 files changed

+14
-36
lines changed

frontend/src/__tests__/components/forms/EmailTemplateForm/server-action.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ describe('CreateEmailTemplate server actions', () => {
8484
errorState: {
8585
formErrors: [],
8686
fieldErrors: {
87-
emailTemplateMessage: [
88-
'The message includes an insecure http:// link. All links must use https://',
89-
],
87+
emailTemplateMessage: ['URLs cannot start with http://'],
9088
},
9189
},
9290
});

frontend/src/__tests__/components/forms/NhsAppTemplateForm/server-action.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ describe('CreateNHSAppTemplate server actions', () => {
8787
errorState: {
8888
formErrors: [],
8989
fieldErrors: {
90-
nhsAppTemplateMessage: [
91-
'The message includes an insecure http:// link. All links must use https://',
92-
],
90+
nhsAppTemplateMessage: ['URLs cannot start with http://'],
9391
},
9492
},
9593
});
@@ -111,9 +109,7 @@ describe('CreateNHSAppTemplate server actions', () => {
111109
errorState: {
112110
formErrors: [],
113111
fieldErrors: {
114-
nhsAppTemplateMessage: [
115-
'The message includes a link that contains an angle bracket character. They must be removed or URL encoded',
116-
],
112+
nhsAppTemplateMessage: ['URLs cannot include the symbols < or >'],
117113
},
118114
},
119115
});

frontend/src/__tests__/components/forms/SmsTemplateForm/server-action.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ describe('CreateSmsTemplate server actions', () => {
8181
errorState: {
8282
formErrors: [],
8383
fieldErrors: {
84-
smsTemplateMessage: [
85-
'The message includes an insecure http:// link. All links must use https://',
86-
],
84+
smsTemplateMessage: ['URLs cannot start with http://'],
8785
},
8886
},
8987
});

frontend/src/content/content.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ const goBackButtonText = 'Go back';
1010
const enterATemplateName = 'Enter a template name';
1111
const enterATemplateMessage = 'Enter a template message';
1212
const templateMessageTooLong = 'Template message too long';
13-
const templateMessageHasInsecureLink =
14-
'The message includes an insecure http:// link. All links must use https://';
13+
const templateMessageHasInsecureLink = 'URLs cannot start with http://';
1514
const selectAnOption = 'Select an option';
1615

1716
const header = {
@@ -795,8 +794,7 @@ const templateFormNhsApp = {
795794
empty: enterATemplateMessage,
796795
max: templateMessageTooLong,
797796
insecureLink: templateMessageHasInsecureLink,
798-
invalidUrlCharacter:
799-
'The message includes a link that contains an angle bracket character. They must be removed or URL encoded',
797+
invalidUrlCharacter: 'URLs cannot include the symbols < or >',
800798
},
801799
},
802800
},

tests/test-team/template-mgmt-component-tests/email/template-mgmt-create-email-page.component.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@ test.describe('Create Email message template Page', () => {
342342
test('when user submits form with an http link, then an error is displayed', async ({
343343
page,
344344
}) => {
345-
const errorMessage =
346-
'The message includes an insecure http:// link. All links must use https://';
345+
const errorMessage = 'URLs cannot start with http://';
347346

348347
const createEmailTemplatePage = new TemplateMgmtCreateEmailPage(page);
349348

tests/test-team/template-mgmt-component-tests/email/template-mgmt-edit-email-page.component.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,7 @@ test.describe('Edit Email message template Page', () => {
423423
test('when user submits form with an http link, then an error is displayed', async ({
424424
page,
425425
}) => {
426-
const errorMessage =
427-
'The message includes an insecure http:// link. All links must use https://';
426+
const errorMessage = 'URLs cannot start with http://';
428427

429428
const createEmailTemplatePage = new TemplateMgmtEditEmailPage(page);
430429

tests/test-team/template-mgmt-component-tests/nhs-app/template-mgmt-create-nhs-app-template-page.component.spec.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ test.describe('Create NHS App Template Page', () => {
174174

175175
await expect(
176176
page.locator('ul[class="nhsuk-list nhsuk-error-summary__list"] > li')
177-
).toHaveText([
178-
'The message includes an insecure http:// link. All links must use https://',
179-
]);
177+
).toHaveText(['URLs cannot start with http://']);
180178
});
181179

182180
test('Validate error messages on the create NHS App message template page with angle brackets in linked url', async ({
@@ -197,9 +195,7 @@ test.describe('Create NHS App Template Page', () => {
197195

198196
await expect(
199197
page.locator('ul[class="nhsuk-list nhsuk-error-summary__list"] > li')
200-
).toHaveText([
201-
'The message includes a link that contains an angle bracket character. They must be removed or URL encoded',
202-
]);
198+
).toHaveText(['URLs cannot include the symbols < or >']);
203199
});
204200

205201
const detailsSections = [

tests/test-team/template-mgmt-component-tests/nhs-app/template-mgmt-edit-nhs-app-template-page.component.spec.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,7 @@ test.describe('Edit NHS App Template Page', () => {
235235

236236
await expect(
237237
page.locator('ul[class="nhsuk-list nhsuk-error-summary__list"] > li')
238-
).toHaveText([
239-
'The message includes an insecure http:// link. All links must use https://',
240-
]);
238+
).toHaveText(['URLs cannot start with http://']);
241239
});
242240

243241
test('Validate error messages on the edit NHS App message template page with angle brackets in linked url', async ({
@@ -258,9 +256,7 @@ test.describe('Edit NHS App Template Page', () => {
258256

259257
await expect(
260258
page.locator('ul[class="nhsuk-list nhsuk-error-summary__list"] > li')
261-
).toHaveText([
262-
'The message includes a link that contains an angle bracket character. They must be removed or URL encoded',
263-
]);
259+
).toHaveText(['URLs cannot include the symbols < or >']);
264260
});
265261

266262
const detailsSections = [

tests/test-team/template-mgmt-component-tests/sms/template-mgmt-create-sms-page.component.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,7 @@ test.describe('Create SMS message template Page', () => {
315315
test('when user submits form with an http link, then an error is displayed', async ({
316316
page,
317317
}) => {
318-
const errorMessage =
319-
'The message includes an insecure http:// link. All links must use https://';
318+
const errorMessage = 'URLs cannot start with http://';
320319

321320
const createSmsTemplatePage = new TemplateMgmtCreateSmsPage(page);
322321

tests/test-team/template-mgmt-component-tests/sms/template-mgmt-edit-sms-page.component.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,7 @@ test.describe('Edit SMS message template Page', () => {
391391
test('when user submits form with an http link, then an error is displayed', async ({
392392
page,
393393
}) => {
394-
const errorMessage =
395-
'The message includes an insecure http:// link. All links must use https://';
394+
const errorMessage = 'URLs cannot start with http://';
396395

397396
const createSmsTemplatePage = new TemplateMgmtEditSmsPage(page);
398397

0 commit comments

Comments
 (0)