Skip to content

Commit e03344f

Browse files
committed
CCM-11492 Fix failing unit tests
1 parent 5b24547 commit e03344f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import {
1010
import { MessageOrder } from 'nhs-notify-web-template-management-utils';
1111
import { MessagePlanForm } from '@forms/MessagePlan/MessagePlan';
1212
import { verifyFormCsrfToken } from '@utils/csrf-utils';
13-
import { createRoutingConfig } from '@utils/form-actions';
1413
import {
1514
NextRedirectBoundary,
1615
NextRedirectError,
1716
} from '../../../helpers/next-redirect';
17+
import { createRoutingConfig } from '@utils/message-plans';
1818

1919
jest.mock('next/navigation');
2020
jest.mock('@utils/csrf-utils');
21-
jest.mock('@utils/form-actions');
21+
jest.mock('@utils/message-plans');
2222

2323
beforeEach(() => {
2424
jest.resetAllMocks();

frontend/src/__tests__/utils/message-plans.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jest.mock('nhs-notify-backend-client', () => {
3232
return {
3333
routingConfigurationApiClient: {
3434
get: jest.fn(),
35+
list: jest.fn(),
36+
create: jest.fn(),
37+
count: jest.fn(),
3538
update: jest.fn(),
3639
},
3740
$RoutingConfig: actual.$RoutingConfig,
@@ -105,9 +108,6 @@ describe('Message plans actions', () => {
105108
errorMeta: { code: 400, description: 'Bad request' },
106109
},
107110
});
108-
await expect(getMessagePlan(validRoutingConfigId)).rejects.toThrow(
109-
'Failed to get access token'
110-
);
111111

112112
const response = await getRoutingConfigs();
113113
expect(response.length).toBe(0);
@@ -597,7 +597,7 @@ describe('Message plans actions', () => {
597597
],
598598
cascadeGroupOverrides: [{ name: 'standard' }],
599599
},
600-
'token'
600+
'mock-token'
601601
);
602602

603603
expect(result).toEqual({

frontend/src/components/forms/MessagePlan/server-action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
type FormState,
1111
type MessageOrder,
1212
} from 'nhs-notify-web-template-management-utils';
13-
import { createRoutingConfig } from '@utils/form-actions';
13+
import { createRoutingConfig } from '@utils/message-plans';
1414

1515
const $MessagePlanFormData = z.object({
1616
campaignId: z.string().min(1, { error: 'Select a campaign' }),

0 commit comments

Comments
 (0)