Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
449 commits
Select commit Hold shift + click to select a range
77bd416
add page container
alexnuttall Feb 17, 2026
09b4cd9
refactor
alexnuttall Feb 18, 2026
f53d8b7
cves
alexnuttall Feb 18, 2026
206c5ec
fix sandbox_auth
alexnuttall Feb 18, 2026
b6f5ae2
merge
alexnuttall Feb 18, 2026
5ccd147
fix up types
alexnuttall Feb 18, 2026
622ed81
Merge branch 'feature/13494-render-preview' into feature/14558-render
alexnuttall Feb 18, 2026
c81112b
rm custom error types
alexnuttall Feb 18, 2026
3e51c79
Merge remote-tracking branch 'origin/main' into feature/14558-render
alexnuttall Feb 18, 2026
f13c7a7
cleanup stray platform changes
alexnuttall Feb 18, 2026
d03f560
use api derived types
alexnuttall Feb 18, 2026
7604102
add current version
alexnuttall Feb 18, 2026
7f010b3
refactor repo
alexnuttall Feb 18, 2026
39dbe75
infra tests
alexnuttall Feb 18, 2026
12c1243
api test
alexnuttall Feb 18, 2026
925ae8e
jest config
alexnuttall Feb 18, 2026
5b0cd9b
jest config
alexnuttall Feb 18, 2026
883282c
init
alexnuttall Feb 18, 2026
fc51684
fmt
alexnuttall Feb 18, 2026
9cfbd1a
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 19, 2026
5551cfd
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 19, 2026
fd1b2f8
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 19, 2026
c8ffbe5
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 19, 2026
2366be8
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 19, 2026
0fbc8ec
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 19, 2026
b610a63
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 19, 2026
9de0c1a
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 19, 2026
8f77d4f
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 20, 2026
826a64d
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 20, 2026
561e5a0
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 20, 2026
b0ec09f
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 20, 2026
8d00095
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 20, 2026
86cf232
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 20, 2026
243a95c
CCM-14149: Fix Image Reference
jamesthompson26-nhs Feb 20, 2026
95b9eec
docx fixture tests
alexnuttall Feb 23, 2026
5421a6c
log
alexnuttall Feb 23, 2026
22a33d9
log
alexnuttall Feb 23, 2026
99486b7
CCM-14211: Upload docx letter endpoint
chris-elliott-nhsd Feb 19, 2026
2dc327f
CCM-14211: Post-rebase fixes
chris-elliott-nhsd Feb 19, 2026
70f50e3
CCM-14211: Fix CI
chris-elliott-nhsd Feb 19, 2026
60dbe9e
CCM-14211: Fix CI
chris-elliott-nhsd Feb 19, 2026
5f92130
CCM-14211: trivy ignore
chris-elliott-nhsd Feb 19, 2026
88e2f42
CCM-14211: Fix test data generation
chris-elliott-nhsd Feb 19, 2026
e0165d8
CCM-14211: Add api tests
chris-elliott-nhsd Feb 20, 2026
ce799fe
CCM-14211: Test updates
chris-elliott-nhsd Feb 20, 2026
0d788f1
CCM-14211: Fix linting
chris-elliott-nhsd Feb 20, 2026
33e5ec8
CCM-14211: Fix API tests
chris-elliott-nhsd Feb 20, 2026
c99b8f5
CCM-14211: Fix linting
chris-elliott-nhsd Feb 20, 2026
ca7cb31
CCM-14211: Fix tests
chris-elliott-nhsd Feb 20, 2026
2a8b37f
CCM-14211: Fix linting
chris-elliott-nhsd Feb 20, 2026
7749748
CCM-14211: Cleanup
chris-elliott-nhsd Feb 20, 2026
a9dcec8
rm duplicated index
alexnuttall Feb 23, 2026
0a827b0
Merge remote-tracking branch 'origin/main' into feature/CCM-14149_Fix…
alexnuttall Feb 23, 2026
a565ebb
restore lambda code
alexnuttall Feb 23, 2026
c69c927
CCM-14211: Review comments
chris-elliott-nhsd Feb 23, 2026
b447d1e
CCM-14211: Review comments
chris-elliott-nhsd Feb 23, 2026
5ca9639
fix workspaces
alexnuttall Feb 23, 2026
040a6cb
Merge remote-tracking branch 'origin/main' into feature/14558-coverage
alexnuttall Feb 23, 2026
22c480a
bump schema patch version
alexnuttall Feb 23, 2026
209da92
fmt
alexnuttall Feb 23, 2026
734ca88
rm comments to satisfy linter
alexnuttall Feb 23, 2026
5e063ee
CCM-14211: Review comments
chris-elliott-nhsd Feb 23, 2026
59ec2ad
Merge branch 'feature/CCM-14149_Fix_Image_Reference' into feature/145…
alexnuttall Feb 23, 2026
c11b6a6
fallback
alexnuttall Feb 23, 2026
541a893
tests pass
alexnuttall Feb 23, 2026
feaf9c8
CCM-14211: Fix tests
chris-elliott-nhsd Feb 23, 2026
21a31bb
component test fix
alexnuttall Feb 23, 2026
25e230d
Merge remote-tracking branch 'origin/main' into feature/14558-render
alexnuttall Feb 23, 2026
993c4e3
rename validation errors field
alexnuttall Feb 23, 2026
6f8be39
rename updateSuccess
alexnuttall Feb 23, 2026
d22a111
Merge remote-tracking branch 'origin/main' into feature/CCM-14211_upl…
alexnuttall Feb 23, 2026
6277453
Merge branch 'feature/CCM-14211_upload-docx' into feature/14558-render
alexnuttall Feb 23, 2026
146961c
lockfile
alexnuttall Feb 23, 2026
ba76c92
lint fix
alexnuttall Feb 23, 2026
233c1e6
fix err log
alexnuttall Feb 23, 2026
8ac77f1
fix source loc
alexnuttall Feb 23, 2026
e6f6753
fix personalisation extraction
alexnuttall Feb 23, 2026
a0bc6ed
fix render path
alexnuttall Feb 23, 2026
6227db0
restore noreferrer
alexnuttall Feb 23, 2026
132c4e7
set content type
alexnuttall Feb 23, 2026
d2a073e
content disposition
alexnuttall Feb 23, 2026
e2da20d
backend suite
alexnuttall Feb 24, 2026
3cdd482
hide renderer if initial template is not rendered
alexnuttall Feb 24, 2026
f93f064
backend test
alexnuttall Feb 24, 2026
5420b13
fix currentVersion
alexnuttall Feb 24, 2026
3afd053
fix s3 test helper
alexnuttall Feb 24, 2026
7487d15
add explicit autocomplete directive
alexnuttall Feb 25, 2026
97ec855
test cleanup
alexnuttall Feb 25, 2026
f75f04a
rm stray test file
alexnuttall Feb 25, 2026
9732ea3
restore checksum default in s3 repo
alexnuttall Feb 25, 2026
5274ebf
backend test CI fix
alexnuttall Feb 25, 2026
88b49f7
pin client-dynamodb
alexnuttall Feb 25, 2026
a4334b4
pin client-dynamodb
alexnuttall Feb 25, 2026
85cef9d
Merge branch 'main' into feature/CCM-14211_upload-docx
chris-elliott-nhsd Feb 25, 2026
1b6bb0f
consolidate ddb tests
alexnuttall Feb 25, 2026
56759eb
Merge branch 'feature/CCM-14211_upload-docx' into feature/14558-render
alexnuttall Feb 25, 2026
495e4e9
Merge remote-tracking branch 'origin/main' into feature/14558-render
alexnuttall Feb 25, 2026
7aebc09
Merge branch 'main' into feature/14558-coverage
alexnuttall Feb 25, 2026
0ec21e9
add handler test
alexnuttall Feb 25, 2026
c7f2e79
lockfile
alexnuttall Feb 26, 2026
8b2533a
test cleanup
alexnuttall Feb 26, 2026
f2d8a93
test cleanup and random bytes test
alexnuttall Feb 26, 2026
051cf6f
remove placeholder error content
alexnuttall Feb 26, 2026
385f0c9
add error content placeholders
alexnuttall Feb 26, 2026
785e478
editor config ignore
alexnuttall Feb 26, 2026
e178de8
editor config ignore
alexnuttall Feb 26, 2026
f8af288
editor config ignore
alexnuttall Feb 26, 2026
2dbc3ea
editor config ignore
alexnuttall Feb 26, 2026
a9112c1
zipped random bytes test
alexnuttall Feb 26, 2026
3405e14
init
alexnuttall Feb 26, 2026
c000f5a
trivyignore
alexnuttall Feb 26, 2026
9af42d9
lockfile
alexnuttall Feb 26, 2026
b68003a
hide page counts when initial render is not RENDERED
alexnuttall Feb 26, 2026
ac24f35
Merge branch 'feature/14558-upgrade-sdk' into feature/14558-render
alexnuttall Feb 26, 2026
767c5a8
lockfile
alexnuttall Feb 26, 2026
f1b736e
rm pkg json override
alexnuttall Feb 26, 2026
24df17c
fix sdk versions in new package
alexnuttall Feb 26, 2026
2988a81
Merge remote-tracking branch 'origin/main' into feature/14558-upgrade…
alexnuttall Feb 26, 2026
77713b5
Merge branch 'feature/14558-upgrade-sdk' into feature/14558-render
alexnuttall Feb 26, 2026
9b99997
use type package in new lambda
alexnuttall Feb 26, 2026
22eafc1
make initial required
alexnuttall Feb 27, 2026
005a046
add initial render to test fixtures
alexnuttall Feb 27, 2026
fea57e9
playwright remove no initial render test
alexnuttall Feb 27, 2026
f490500
add spinner component
alexnuttall Feb 27, 2026
5695ae0
route handler
alexnuttall Feb 27, 2026
c4a7a6c
add requestedAt to render objects
alexnuttall Feb 27, 2026
c631d8b
update zod schema with requestedat
alexnuttall Feb 27, 2026
599fcf7
requestedAt only on PENDING
alexnuttall Feb 27, 2026
87ea495
rm PersonalisedRenderDetails type
alexnuttall Feb 27, 2026
0a20cc8
requested is mandatory on PENDING render
alexnuttall Feb 27, 2026
8b41385
tests passing
alexnuttall Feb 27, 2026
f44ecd3
fix frontend tests
alexnuttall Feb 27, 2026
18e9818
Merge remote-tracking branch 'origin/main' into feature/14558-render
alexnuttall Feb 27, 2026
4b07a3e
lockfile
alexnuttall Feb 27, 2026
6d7de1b
force lockfile change
alexnuttall Feb 27, 2026
f86f8c6
fix flaky url assertion
alexnuttall Feb 27, 2026
8e2523c
Merge remote-tracking branch 'origin/main' into feature/14558-render
alexnuttall Feb 27, 2026
07a7fa3
Merge branch 'feature/14558-render' into feature/13492-initial-spinner
alexnuttall Feb 27, 2026
1f0da96
fix teardown
alexnuttall Feb 27, 2026
f22d58b
timeout
alexnuttall Mar 2, 2026
f601ae9
content fix
alexnuttall Mar 2, 2026
956b829
generic hook
alexnuttall Mar 2, 2026
ac796cd
onerror tests
alexnuttall Mar 2, 2026
7a60ba8
fix snaps
alexnuttall Mar 2, 2026
e4fe1aa
comments
alexnuttall Mar 2, 2026
09cc5c7
rm mochawesome
alexnuttall Mar 2, 2026
e8a459a
Merge branch 'feature/14558-render' into feature/13492-initial-spinner
alexnuttall Mar 2, 2026
8b26d7b
cleanup
alexnuttall Mar 2, 2026
859a57a
move tests to component not page
alexnuttall Mar 2, 2026
ba375e3
rename hook
alexnuttall Mar 2, 2026
ebc1624
restore missing page tests
alexnuttall Mar 2, 2026
3eaf0b6
use router.refresh
alexnuttall Mar 2, 2026
a4b8648
spinner accessibility
alexnuttall Mar 2, 2026
99adb34
refactor shouldPoll
alexnuttall Mar 2, 2026
4943f22
reorganise content
alexnuttall Mar 3, 2026
987e497
Merge remote-tracking branch 'origin/main' into feature/13492-initial…
alexnuttall Mar 3, 2026
36a06a8
pw test fixes
alexnuttall Mar 3, 2026
8cf7f2c
api and backend test fixes
alexnuttall Mar 3, 2026
264ef30
pass tag through renderPoll
alexnuttall Mar 3, 2026
42cc0d3
Merge remote-tracking branch 'origin/main' into feature/14558-coverage
alexnuttall Mar 3, 2026
0082af8
gss
alexnuttall Mar 3, 2026
e7c5114
spec
alexnuttall Mar 3, 2026
430dd5a
terraform
alexnuttall Mar 3, 2026
0dc0f66
wip
alexnuttall Mar 3, 2026
7faaf1b
renderer initial
alexnuttall Mar 3, 2026
44ad08e
pack ID
alexnuttall Mar 3, 2026
c7632a6
init test
alexnuttall Mar 3, 2026
ccd741e
restore currentVersion
alexnuttall Mar 3, 2026
24eabd4
backend test
alexnuttall Mar 3, 2026
ceda9bd
stray comments
alexnuttall Mar 3, 2026
e7fd8e2
curl readme
alexnuttall Mar 4, 2026
435d770
Merge branch 'feature/13492-initial-spinner' into feature/14770-perso…
alexnuttall Mar 4, 2026
16777e9
lockfile
alexnuttall Mar 4, 2026
e04d216
rename request payload type
alexnuttall Mar 4, 2026
8396723
stop poll if template status is not NOT_YET_SUBMITTED
alexnuttall Mar 4, 2026
388e3d5
stop poll if template status is VALIDATION_FAILED
alexnuttall Mar 4, 2026
aaebd8f
201 not 200 resp
alexnuttall Mar 4, 2026
ecc715c
readme fix
alexnuttall Mar 4, 2026
96336cd
layout fix
alexnuttall Mar 4, 2026
5ec67f7
form key fix
alexnuttall Mar 4, 2026
c0e3133
rm client flag check
alexnuttall Mar 4, 2026
ce59b02
use map to dto
alexnuttall Mar 4, 2026
1a0171b
rename current version
alexnuttall Mar 4, 2026
cc438c0
backend api unit tests
alexnuttall Mar 4, 2026
51fd60d
Merge branch 'feature/14558-coverage' into feature/14770-personalised…
alexnuttall Mar 4, 2026
e611e6e
coverage
alexnuttall Mar 4, 2026
3b74572
post render db updates
alexnuttall Mar 4, 2026
ef12c75
renderer unit tests
alexnuttall Mar 4, 2026
1297e70
backend test
alexnuttall Mar 4, 2026
84c3070
api tests
alexnuttall Mar 4, 2026
65a2281
unit tests
alexnuttall Mar 4, 2026
e71f71b
lockfile
alexnuttall Mar 4, 2026
1ed9215
update builder tests
alexnuttall Mar 4, 2026
70101c1
merge fixes
alexnuttall Mar 4, 2026
a2459ec
Merge remote-tracking branch 'origin/main' into feature/13492-initial…
alexnuttall Mar 4, 2026
fc04b43
Merge branch 'feature/13492-initial-spinner' into feature/14770-perso…
alexnuttall Mar 4, 2026
1ce36af
test.each etc
alexnuttall Mar 4, 2026
453b691
more test cleanup
alexnuttall Mar 4, 2026
1294f51
api test cleanup
alexnuttall Mar 4, 2026
11c4fa9
comment
alexnuttall Mar 9, 2026
5ff84fa
Merge remote-tracking branch 'origin/main' into feature/13492-initial…
alexnuttall Mar 9, 2026
ae02157
Merge branch 'feature/13492-initial-spinner' into feature/14770-perso…
alexnuttall Mar 9, 2026
f67a342
package lock
alexnuttall Mar 9, 2026
0bd7466
Merge branch 'feature/13492-initial-spinner' into feature/14770-perso…
alexnuttall Mar 9, 2026
b9b760e
cves
alexnuttall Mar 9, 2026
2e049a4
Merge branch 'feature/13492-initial-spinner' into feature/14770-perso…
alexnuttall Mar 9, 2026
7549e8d
fix unit test locknumber parsing
alexnuttall Mar 9, 2026
6562b31
increase move to prod timeout
alexnuttall Mar 9, 2026
82c4850
Merge branch 'feature/13492-initial-spinner' into feature/14770-perso…
alexnuttall Mar 9, 2026
89b5521
init
alexnuttall Mar 9, 2026
e4d8b2f
Merge remote-tracking branch 'origin/main' into feature/13492-initial…
alexnuttall Mar 9, 2026
3bdfd7f
Merge branch 'feature/13492-initial-spinner' into feature/14770-perso…
alexnuttall Mar 9, 2026
9c48ea9
Merge branch 'feature/14770-personalised-render' into feature/CCM-134…
alexnuttall Mar 9, 2026
7cb690e
optimistic spinning
alexnuttall Mar 9, 2026
275bca0
accessibility tests
alexnuttall Mar 10, 2026
5c76fed
Merge branch 'feature/13492-initial-spinner' into feature/14770-perso…
alexnuttall Mar 10, 2026
f84523b
Merge branch 'feature/14770-personalised-render' into feature/CCM-134…
alexnuttall Mar 10, 2026
d483779
unmock hook
alexnuttall Mar 10, 2026
b0952f2
revert stray button disabled
alexnuttall Mar 10, 2026
51cf166
Merge branch 'feature/13492-initial-spinner' into feature/14770-perso…
alexnuttall Mar 10, 2026
c9db326
Merge remote-tracking branch 'origin/main' into feature/14770-persona…
alexnuttall Mar 10, 2026
82c8d12
Merge branch 'feature/14770-personalised-render' into feature/CCM-134…
alexnuttall Mar 10, 2026
13d4e33
fix post merge
alexnuttall Mar 10, 2026
f78ce8c
lint fix
alexnuttall Mar 10, 2026
c6e3c49
log url
alexnuttall Mar 11, 2026
395a949
Merge remote-tracking branch 'origin/main' into feature/14770-persona…
alexnuttall Mar 11, 2026
305ba1c
Merge branch 'feature/14770-personalised-render' into feature/CCM-134…
alexnuttall Mar 11, 2026
f3b9eaf
polling bug
alexnuttall Mar 11, 2026
6124caa
spped up optimistic polling transition
alexnuttall Mar 11, 2026
ef5ccb4
button context
alexnuttall Mar 11, 2026
96301d7
rename lamdba, endpoint, api handler and template client method
alexnuttall Mar 11, 2026
b3d43fa
regen types
alexnuttall Mar 11, 2026
0217489
Merge branch 'feature/14770-personalised-render' into feature/CCM-134…
alexnuttall Mar 11, 2026
093b4b3
backend test fix
alexnuttall Mar 11, 2026
26528ba
Merge branch 'feature/14770-personalised-render' into feature/CCM-134…
alexnuttall Mar 11, 2026
3b6282f
lint
alexnuttall Mar 11, 2026
4ec9284
fix api client
alexnuttall Mar 11, 2026
43f8bce
cleanup
alexnuttall Mar 11, 2026
c52988b
test cleanup
alexnuttall Mar 11, 2026
567a555
test cleanup
alexnuttall Mar 11, 2026
d3db338
component test
alexnuttall Mar 12, 2026
7da9c01
Merge remote-tracking branch 'origin/main' into feature/CCM-13495-upd…
alexnuttall Mar 12, 2026
aa39c26
personalisation.ts fixes
alexnuttall Mar 12, 2026
bef9a1b
duplicate tf mod
alexnuttall Mar 12, 2026
cee1561
css fix
alexnuttall Mar 12, 2026
90620ef
css fix
alexnuttall Mar 12, 2026
f0d664e
fix spinner text
alexnuttall Mar 12, 2026
94a9ad8
tidy
alexnuttall Mar 13, 2026
3692ce0
use notify button component
alexnuttall Mar 13, 2026
46a04b9
tests for personalisation building
alexnuttall Mar 13, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
role="tabpanel"
>
<div
class="nhsuk-grid-row"
class="nhsuk-grid-row tabRow"
>
<div
class="nhsuk-grid-column-one-third"
Expand Down Expand Up @@ -314,7 +314,7 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
<select
class="nhsuk-select recipientSelect"
id="system-personalisation-pack-id-shortFormRender"
name="__systemPersonalisationPackId"
name="systemPersonalisationPackId"
>
<option
selected=""
Expand Down Expand Up @@ -379,6 +379,21 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
</option>
</select>
</div>
<input
name="templateId"
type="hidden"
value="authoring-letter-template-id"
/>
<input
name="lockNumber"
type="hidden"
value="1"
/>
<input
name="tab"
type="hidden"
value="shortFormRender"
/>
<button
aria-disabled="false"
class="nhsuk-button nhsuk-button--secondary nhsuk-u-margin-top-4"
Expand Down Expand Up @@ -406,7 +421,7 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
role="tabpanel"
>
<div
class="nhsuk-grid-row"
class="nhsuk-grid-row tabRow"
>
<div
class="nhsuk-grid-column-one-third"
Expand Down Expand Up @@ -448,7 +463,7 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
<select
class="nhsuk-select recipientSelect"
id="system-personalisation-pack-id-longFormRender"
name="__systemPersonalisationPackId"
name="systemPersonalisationPackId"
>
<option
selected=""
Expand Down Expand Up @@ -513,6 +528,21 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
</option>
</select>
</div>
<input
name="templateId"
type="hidden"
value="authoring-letter-template-id"
/>
<input
name="lockNumber"
type="hidden"
value="1"
/>
<input
name="tab"
type="hidden"
value="longFormRender"
/>
<button
aria-disabled="false"
class="nhsuk-button nhsuk-button--secondary nhsuk-u-margin-top-4"
Expand Down Expand Up @@ -791,7 +821,7 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
role="tabpanel"
>
<div
class="nhsuk-grid-row"
class="nhsuk-grid-row tabRow"
>
<div
class="nhsuk-grid-column-one-third"
Expand Down Expand Up @@ -833,7 +863,7 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
<select
class="nhsuk-select recipientSelect"
id="system-personalisation-pack-id-shortFormRender"
name="__systemPersonalisationPackId"
name="systemPersonalisationPackId"
>
<option
selected=""
Expand Down Expand Up @@ -898,6 +928,21 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
</option>
</select>
</div>
<input
name="templateId"
type="hidden"
value="authoring-letter-template-id"
/>
<input
name="lockNumber"
type="hidden"
value="1"
/>
<input
name="tab"
type="hidden"
value="shortFormRender"
/>
<button
aria-disabled="false"
class="nhsuk-button nhsuk-button--secondary nhsuk-u-margin-top-4"
Expand Down Expand Up @@ -925,7 +970,7 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
role="tabpanel"
>
<div
class="nhsuk-grid-row"
class="nhsuk-grid-row tabRow"
>
<div
class="nhsuk-grid-column-one-third"
Expand Down Expand Up @@ -967,7 +1012,7 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
<select
class="nhsuk-select recipientSelect"
id="system-personalisation-pack-id-longFormRender"
name="__systemPersonalisationPackId"
name="systemPersonalisationPackId"
>
<option
selected=""
Expand Down Expand Up @@ -1032,6 +1077,21 @@ exports[`authoring letter template with VALIDATION_FAILED status matches snapsho
</option>
</select>
</div>
<input
name="templateId"
type="hidden"
value="authoring-letter-template-id"
/>
<input
name="lockNumber"
type="hidden"
value="1"
/>
<input
name="tab"
type="hidden"
value="longFormRender"
/>
<button
aria-disabled="false"
class="nhsuk-button nhsuk-button--secondary nhsuk-u-margin-top-4"
Expand Down Expand Up @@ -1538,7 +1598,7 @@ exports[`valid authoring letter template matches snapshot 1`] = `
role="tabpanel"
>
<div
class="nhsuk-grid-row"
class="nhsuk-grid-row tabRow"
>
<div
class="nhsuk-grid-column-one-third"
Expand Down Expand Up @@ -1580,7 +1640,7 @@ exports[`valid authoring letter template matches snapshot 1`] = `
<select
class="nhsuk-select recipientSelect"
id="system-personalisation-pack-id-shortFormRender"
name="__systemPersonalisationPackId"
name="systemPersonalisationPackId"
>
<option
selected=""
Expand Down Expand Up @@ -1645,6 +1705,21 @@ exports[`valid authoring letter template matches snapshot 1`] = `
</option>
</select>
</div>
<input
name="templateId"
type="hidden"
value="authoring-letter-template-id"
/>
<input
name="lockNumber"
type="hidden"
value="1"
/>
<input
name="tab"
type="hidden"
value="shortFormRender"
/>
<button
aria-disabled="false"
class="nhsuk-button nhsuk-button--secondary nhsuk-u-margin-top-4"
Expand Down Expand Up @@ -1672,7 +1747,7 @@ exports[`valid authoring letter template matches snapshot 1`] = `
role="tabpanel"
>
<div
class="nhsuk-grid-row"
class="nhsuk-grid-row tabRow"
>
<div
class="nhsuk-grid-column-one-third"
Expand Down Expand Up @@ -1714,7 +1789,7 @@ exports[`valid authoring letter template matches snapshot 1`] = `
<select
class="nhsuk-select recipientSelect"
id="system-personalisation-pack-id-longFormRender"
name="__systemPersonalisationPackId"
name="systemPersonalisationPackId"
>
<option
selected=""
Expand Down Expand Up @@ -1779,6 +1854,21 @@ exports[`valid authoring letter template matches snapshot 1`] = `
</option>
</select>
</div>
<input
name="templateId"
type="hidden"
value="authoring-letter-template-id"
/>
<input
name="lockNumber"
type="hidden"
value="1"
/>
<input
name="tab"
type="hidden"
value="longFormRender"
/>
<button
aria-disabled="false"
class="nhsuk-button nhsuk-button--secondary nhsuk-u-margin-top-4"
Expand Down Expand Up @@ -1830,6 +1920,7 @@ exports[`valid authoring letter template matches snapshot 1`] = `
value="1"
/>
<button
aria-disabled="false"
class="nhsuk-button"
data-testid="preview-letter-template-cta"
id="preview-letter-template-cta"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Page, {
} from '@app/preview-letter-template/[templateId]/page';
import { submitAuthoringLetterAction } from '@app/preview-letter-template/[templateId]/server-action';
import content from '@content/content';
import { RENDER_TIMEOUT_MS } from '@hooks/use-letter-template-poll';
import { RENDER_TIMEOUT_MS } from '@molecules/PollLetterRender/PollLetterRender';

jest.mock('@utils/form-actions');
jest.mock('next/navigation');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { render, screen } from '@testing-library/react';
import type { PropsWithChildren } from 'react';
import { LetterRender } from '@molecules/LetterRender';
import { LetterRenderPollingProvider } from '@providers/letter-render-polling-provider';
import type { AuthoringLetterTemplate } from 'nhs-notify-web-template-management-utils';
import { verifyFormCsrfToken } from '@utils/csrf-utils';

Expand All @@ -8,10 +10,16 @@ jest.mocked(verifyFormCsrfToken).mockResolvedValue(true);

jest.mock('@molecules/LetterRender/server-action');

jest.mock('next/navigation');

jest.mock('@utils/get-base-path', () => ({
getBasePath: jest.fn(() => '/templates'),
}));

function Provider({ children }: PropsWithChildren) {
return <LetterRenderPollingProvider>{children}</LetterRenderPollingProvider>;
}

const baseTemplate: AuthoringLetterTemplate = {
id: 'template-123',
clientId: 'client-123',
Expand Down Expand Up @@ -43,24 +51,30 @@ const baseTemplate: AuthoringLetterTemplate = {
};

describe('LetterRender', () => {
beforeEach(() => {
jest.clearAllMocks();
});

it('renders tabs for short and long examples', () => {
render(<LetterRender template={baseTemplate} />);
render(<LetterRender template={baseTemplate} />, { wrapper: Provider });

expect(screen.getByText('Short examples')).toBeInTheDocument();
expect(screen.getByText('Long examples')).toBeInTheDocument();
});

it('renders tab content for both tabs', () => {
render(<LetterRender template={baseTemplate} />);
render(<LetterRender template={baseTemplate} />, { wrapper: Provider });

// Both tab contents should be rendered (tabs component renders both, CSS hides inactive)
const tabContents = screen.getAllByRole('tabpanel', { hidden: true });
expect(tabContents).toHaveLength(2);
});

it('matches snapshot', () => {
const container = render(<LetterRender template={baseTemplate} />);
const { asFragment } = render(<LetterRender template={baseTemplate} />, {
wrapper: Provider,
});

expect(container.asFragment()).toMatchSnapshot();
expect(asFragment()).toMatchSnapshot();
});
});
Loading
Loading