Skip to content

Commit 2c5790c

Browse files
committed
Merge remote-tracking branch 'origin/feature/CCM-10387-multi-user-update' into feature/CCM-10387-multi-user-update
2 parents 06e7386 + 68b6e40 commit 2c5790c

File tree

102 files changed

+7034
-4221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+7034
-4221
lines changed

frontend/jest.setup.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ createMocks();
3333

3434
// set feature flag
3535
process.env.NEXT_PUBLIC_ENABLE_PROOFING = 'true';
36+
37+
// mock unimplemented scrollIntoView
38+
if (typeof window !== 'undefined') {
39+
window.HTMLElement.prototype.scrollIntoView = jest.fn();
40+
}

frontend/src/__tests__/components/atoms/__snapshots__/CodeExample.test.tsx.snap

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ exports[`CodeExample component renders component correctly 1`] = `
88
>
99
This is an example of markdown:
1010
</span>
11-
<code
12-
aria-describedby="test-id"
11+
<pre
12+
class="nhsuk-code-block"
1313
>
14-
# A test example
15-
</code>
14+
<code
15+
aria-describedby="test-id"
16+
>
17+
# A test example
18+
</code>
19+
</pre>
1620
</DocumentFragment>
1721
`;
1822

@@ -24,11 +28,15 @@ exports[`CodeExample component renders component correctly when optional class i
2428
>
2529
This is an example of markdown:
2630
</span>
27-
<code
28-
aria-describedby="test-id"
29-
class="test-class"
31+
<pre
32+
class="nhsuk-code-block"
3033
>
31-
# A test example
32-
</code>
34+
<code
35+
aria-describedby="test-id"
36+
class="test-class"
37+
>
38+
# A test example
39+
</code>
40+
</pre>
3341
</DocumentFragment>
3442
`;

frontend/src/__tests__/components/forms/ChooseTemplate/ChooseTemplate.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('Choose template page', () => {
6666
it('renders error component', () => {
6767
const mockUseActionState = jest.fn().mockReturnValue([
6868
{
69-
validationError: {
69+
errorState: {
7070
formErrors: [],
7171
fieldErrors: {
7272
page: ['Component error message'],

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test('submit form - validation error', async () => {
1616
);
1717

1818
expect(response).toEqual({
19-
validationError: {
19+
errorState: {
2020
formErrors: [],
2121
fieldErrors: {
2222
templateType: ['Select a template type'],

frontend/src/__tests__/components/forms/CopyTemplate/CopyTemplate.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('Choose template page', () => {
7070
it('renders error component', () => {
7171
const mockUseActionState = jest.fn().mockReturnValue([
7272
{
73-
validationError: {
73+
errorState: {
7474
formErrors: [],
7575
fieldErrors: {
7676
page: ['Component error message'],

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test('submit form - validation error', async () => {
3838
);
3939

4040
expect(response).toEqual({
41-
validationError: {
41+
errorState: {
4242
formErrors: [],
4343
fieldErrors: {
4444
templateType: ['Select a template type'],

frontend/src/__tests__/components/forms/EmailTemplateForm/EmailTemplateForm.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test('renders page with preloaded field values', () => {
2727
const container = render(
2828
<EmailTemplateForm
2929
initialState={mockDeep<TemplateFormState<EmailTemplate>>({
30-
validationError: undefined,
30+
errorState: undefined,
3131
name: 'template-name',
3232
subject: 'template-subject-line',
3333
message: 'template-message',
@@ -41,7 +41,7 @@ test('renders page without back link for initial state with id - edit mode', ()
4141
const container = render(
4242
<EmailTemplateForm
4343
initialState={mockDeep<TemplateFormState<EmailTemplate>>({
44-
validationError: undefined,
44+
errorState: undefined,
4545
name: 'template-name',
4646
subject: 'template-subject-line',
4747
message: 'template-message',
@@ -56,7 +56,7 @@ test('renders page one error', () => {
5656
const container = render(
5757
<EmailTemplateForm
5858
initialState={mockDeep<TemplateFormState<EmailTemplate>>({
59-
validationError: {
59+
errorState: {
6060
formErrors: [],
6161
fieldErrors: {
6262
emailTemplateName: ['Template name error'],
@@ -75,7 +75,7 @@ test('renders page with multiple errors', () => {
7575
const container = render(
7676
<EmailTemplateForm
7777
initialState={mockDeep<TemplateFormState<EmailTemplate>>({
78-
validationError: {
78+
errorState: {
7979
formErrors: [],
8080
fieldErrors: {
8181
emailTemplateName: ['Template name error'],
@@ -96,7 +96,7 @@ test('Client-side validation triggers', () => {
9696
const container = render(
9797
<EmailTemplateForm
9898
initialState={mockDeep<TemplateFormState<EmailTemplate>>({
99-
validationError: undefined,
99+
errorState: undefined,
100100
name: 'template-name',
101101
subject: 'template-subject-line',
102102
message: 'template-message',

0 commit comments

Comments
 (0)