Skip to content

Commit 42da479

Browse files
committed
CCM-12744: WIP
1 parent 5235568 commit 42da479

File tree

67 files changed

+1501
-364
lines changed

Some content is hidden

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

67 files changed

+1501
-364
lines changed

frontend/src/__tests__/app/choose-templates/__snapshots__/page.test.tsx.snap

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,22 @@ exports[`ChooseTemplatesPage renders correctly for a message plan with multiple
127127
<form>
128128
<input
129129
name="channel"
130+
readonly=""
130131
type="hidden"
131132
value="NHSAPP"
132133
/>
133134
<input
134135
name="routingConfigId"
136+
readonly=""
135137
type="hidden"
136138
value="fbb81055-79b9-4759-ac07-d191ae57be34"
137139
/>
140+
<input
141+
name="lockNumber"
142+
readonly=""
143+
type="hidden"
144+
value="0"
145+
/>
138146
<button
139147
class="channel-template-link--remove nhsuk-link"
140148
data-testid="remove-template-link-NHSAPP"
@@ -300,14 +308,22 @@ exports[`ChooseTemplatesPage renders correctly for a message plan with multiple
300308
<form>
301309
<input
302310
name="channel"
311+
readonly=""
303312
type="hidden"
304313
value="SMS"
305314
/>
306315
<input
307316
name="routingConfigId"
317+
readonly=""
308318
type="hidden"
309319
value="fbb81055-79b9-4759-ac07-d191ae57be34"
310320
/>
321+
<input
322+
name="lockNumber"
323+
readonly=""
324+
type="hidden"
325+
value="0"
326+
/>
311327
<button
312328
class="channel-template-link--remove nhsuk-link"
313329
data-testid="remove-template-link-SMS"
@@ -611,14 +627,22 @@ exports[`ChooseTemplatesPage renders correctly for a message plan with multiple
611627
<form>
612628
<input
613629
name="channel"
630+
readonly=""
614631
type="hidden"
615632
value="LETTER"
616633
/>
617634
<input
618635
name="routingConfigId"
636+
readonly=""
619637
type="hidden"
620638
value="fbb81055-79b9-4759-ac07-d191ae57be34"
621639
/>
640+
<input
641+
name="lockNumber"
642+
readonly=""
643+
type="hidden"
644+
value="0"
645+
/>
622646
<button
623647
class="channel-template-link--remove nhsuk-link"
624648
data-testid="remove-template-link-LETTER"

frontend/src/__tests__/app/choose-templates/page.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const routingConfig: RoutingConfig = {
4141
updatedAt: '2025-01-13T10:19:25.579Z',
4242
cascadeGroupOverrides: [],
4343
cascade: [],
44+
lockNumber: 0,
4445
};
4546

4647
describe('ChooseTemplatesPage', () => {

frontend/src/__tests__/app/message-plans/edit-message-plan-settings/__snapshots__/page.test.tsx.snap

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ exports[`multiple campaigns matches snapshot 1`] = `
168168
type="hidden"
169169
value="d7afdc99-d55b-4f26-8442-2d10aea07346"
170170
/>
171+
<input
172+
name="lockNumber"
173+
readonly=""
174+
type="hidden"
175+
value="0"
176+
/>
171177
</form>
172178
</div>
173179
</div>
@@ -398,6 +404,12 @@ exports[`multiple campaigns renders errors when form is submitted in invalid sta
398404
type="hidden"
399405
value="d7afdc99-d55b-4f26-8442-2d10aea07346"
400406
/>
407+
<input
408+
name="lockNumber"
409+
readonly=""
410+
type="hidden"
411+
value="0"
412+
/>
401413
</form>
402414
</div>
403415
</div>
@@ -558,6 +570,12 @@ exports[`single campaign matches snapshot 1`] = `
558570
type="hidden"
559571
value="d7afdc99-d55b-4f26-8442-2d10aea07346"
560572
/>
573+
<input
574+
name="lockNumber"
575+
readonly=""
576+
type="hidden"
577+
value="0"
578+
/>
561579
</form>
562580
</div>
563581
</div>
@@ -755,6 +773,12 @@ exports[`single campaign renders errors when form is submitted in invalid state
755773
type="hidden"
756774
value="d7afdc99-d55b-4f26-8442-2d10aea07346"
757775
/>
776+
<input
777+
name="lockNumber"
778+
readonly=""
779+
type="hidden"
780+
value="0"
781+
/>
758782
</form>
759783
</div>
760784
</div>

frontend/src/__tests__/app/message-plans/edit-message-plan-settings/page.test.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,14 @@ describe('single campaign', () => {
148148

149149
await user.click(await screen.findByTestId('submit-button'));
150150

151-
expect(updateRoutingConfig).toHaveBeenCalledWith(routingConfig.id, {
152-
name: 'New Name',
153-
campaignId: routingConfig.campaignId,
154-
});
151+
expect(updateRoutingConfig).toHaveBeenCalledWith(
152+
routingConfig.id,
153+
{
154+
name: 'New Name',
155+
campaignId: routingConfig.campaignId,
156+
},
157+
routingConfig.lockNumber
158+
);
155159

156160
expect(redirect).toHaveBeenCalledWith(
157161
`/message-plans/choose-templates/${routingConfig.id}`,
@@ -251,10 +255,14 @@ describe('multiple campaigns', () => {
251255

252256
await user.click(await screen.findByTestId('submit-button'));
253257

254-
expect(updateRoutingConfig).toHaveBeenCalledWith(routingConfig.id, {
255-
name: 'New Name',
256-
campaignId: alternateCampaignId,
257-
});
258+
expect(updateRoutingConfig).toHaveBeenCalledWith(
259+
routingConfig.id,
260+
{
261+
name: 'New Name',
262+
campaignId: alternateCampaignId,
263+
},
264+
routingConfig.lockNumber
265+
);
258266

259267
expect(redirect).toHaveBeenCalledWith(
260268
`/message-plans/choose-templates/${routingConfig.id}`,

frontend/src/__tests__/app/message-plans/page.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const buildRoutingConfig = (rc: Partial<RoutingConfig>): RoutingConfig => ({
2828
id: '',
2929
name: '',
3030
updatedAt: '',
31+
lockNumber: 0,
3132
...rc,
3233
});
3334

frontend/src/__tests__/components/molecules/MessagePlanBlock.test.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ describe('MessagePlanBlock', () => {
2828
index={0}
2929
channelItem={channelItem}
3030
routingConfigId='test-routing-config-id'
31+
lockNumber={42}
3132
/>
3233
);
3334

@@ -47,6 +48,7 @@ describe('MessagePlanBlock', () => {
4748
index={2}
4849
channelItem={channelItem}
4950
routingConfigId='test-routing-config-id'
51+
lockNumber={42}
5052
/>
5153
);
5254

@@ -65,6 +67,7 @@ describe('MessagePlanBlock', () => {
6567
index={0}
6668
channelItem={channelItem}
6769
routingConfigId='test-routing-config-id'
70+
lockNumber={42}
6871
/>
6972
);
7073

@@ -83,6 +86,7 @@ describe('MessagePlanBlock', () => {
8386
channelItem={channelItem}
8487
template={mockTemplate}
8588
routingConfigId='test-routing-config-id'
89+
lockNumber={42}
8690
/>
8791
);
8892
expect(screen.getByText('Test email template')).toBeInTheDocument();
@@ -97,6 +101,7 @@ describe('MessagePlanBlock', () => {
97101
channelItem={channelItem}
98102
template={mockTemplate}
99103
routingConfigId='test-routing-config-id'
104+
lockNumber={42}
100105
/>
101106
);
102107

@@ -121,6 +126,7 @@ describe('MessagePlanBlock', () => {
121126
index={0}
122127
channelItem={channelItem}
123128
routingConfigId='test-routing-config-id'
129+
lockNumber={42}
124130
/>
125131
);
126132

@@ -151,6 +157,7 @@ describe('MessagePlanBlock', () => {
151157
channelItem={channelItem}
152158
template={mockTemplate}
153159
routingConfigId='test-routing-config-id'
160+
lockNumber={42}
154161
/>
155162
);
156163
expect(asFragment()).toMatchSnapshot();
@@ -168,6 +175,7 @@ describe('MessagePlanBlock', () => {
168175
index={0}
169176
channelItem={channelItem}
170177
routingConfigId='test-routing-config-id'
178+
lockNumber={42}
171179
/>
172180
);
173181
expect(asFragment()).toMatchSnapshot();

frontend/src/__tests__/components/molecules/MessagePlanChannelTemplate.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ describe('MessagePlanChannelTemplate', () => {
1010
<MessagePlanChannelTemplate
1111
channel='EMAIL'
1212
routingConfigId={routingConfigId}
13+
lockNumber={42}
1314
/>
1415
);
1516

@@ -25,6 +26,7 @@ describe('MessagePlanChannelTemplate', () => {
2526
channel='LETTER'
2627
required={false}
2728
routingConfigId={routingConfigId}
29+
lockNumber={42}
2830
/>
2931
);
3032
});
@@ -42,6 +44,7 @@ describe('MessagePlanChannelTemplate', () => {
4244
<MessagePlanChannelTemplate
4345
channel='NHSAPP'
4446
routingConfigId={routingConfigId}
47+
lockNumber={42}
4548
/>
4649
);
4750
});
@@ -78,6 +81,7 @@ describe('MessagePlanChannelTemplate', () => {
7881
channel='SMS'
7982
template={testTemplate}
8083
routingConfigId={routingConfigId}
84+
lockNumber={42}
8185
/>
8286
);
8387
});
@@ -131,6 +135,7 @@ describe('MessagePlanChannelTemplate', () => {
131135
<MessagePlanChannelTemplate
132136
channel={channel}
133137
routingConfigId={routingConfigId}
138+
lockNumber={42}
134139
/>
135140
);
136141

@@ -151,6 +156,7 @@ describe('MessagePlanChannelTemplate', () => {
151156
channel={channel}
152157
template={testTemplate}
153158
routingConfigId={routingConfigId}
159+
lockNumber={42}
154160
/>
155161
);
156162
expect(container).toMatchSnapshot();

frontend/src/__tests__/components/molecules/__snapshots__/MessagePlanBlock.test.tsx.snap

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,22 @@ exports[`MessagePlanBlock for channel EMAIL with template should match snapshot
109109
<form>
110110
<input
111111
name="channel"
112+
readonly=""
112113
type="hidden"
113114
value="EMAIL"
114115
/>
115116
<input
116117
name="routingConfigId"
118+
readonly=""
117119
type="hidden"
118120
value="test-routing-config-id"
119121
/>
122+
<input
123+
name="lockNumber"
124+
readonly=""
125+
type="hidden"
126+
value="42"
127+
/>
120128
<button
121129
class="channel-template-link--remove nhsuk-link"
122130
data-testid="remove-template-link-EMAIL"
@@ -249,14 +257,22 @@ exports[`MessagePlanBlock for channel LETTER with template should match snapshot
249257
<form>
250258
<input
251259
name="channel"
260+
readonly=""
252261
type="hidden"
253262
value="LETTER"
254263
/>
255264
<input
256265
name="routingConfigId"
266+
readonly=""
257267
type="hidden"
258268
value="test-routing-config-id"
259269
/>
270+
<input
271+
name="lockNumber"
272+
readonly=""
273+
type="hidden"
274+
value="42"
275+
/>
260276
<button
261277
class="channel-template-link--remove nhsuk-link"
262278
data-testid="remove-template-link-LETTER"
@@ -389,14 +405,22 @@ exports[`MessagePlanBlock for channel NHSAPP with template should match snapshot
389405
<form>
390406
<input
391407
name="channel"
408+
readonly=""
392409
type="hidden"
393410
value="NHSAPP"
394411
/>
395412
<input
396413
name="routingConfigId"
414+
readonly=""
397415
type="hidden"
398416
value="test-routing-config-id"
399417
/>
418+
<input
419+
name="lockNumber"
420+
readonly=""
421+
type="hidden"
422+
value="42"
423+
/>
400424
<button
401425
class="channel-template-link--remove nhsuk-link"
402426
data-testid="remove-template-link-NHSAPP"
@@ -529,14 +553,22 @@ exports[`MessagePlanBlock for channel SMS with template should match snapshot 1`
529553
<form>
530554
<input
531555
name="channel"
556+
readonly=""
532557
type="hidden"
533558
value="SMS"
534559
/>
535560
<input
536561
name="routingConfigId"
562+
readonly=""
537563
type="hidden"
538564
value="test-routing-config-id"
539565
/>
566+
<input
567+
name="lockNumber"
568+
readonly=""
569+
type="hidden"
570+
value="42"
571+
/>
540572
<button
541573
class="channel-template-link--remove nhsuk-link"
542574
data-testid="remove-template-link-SMS"

0 commit comments

Comments
 (0)