Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
@@ -0,0 +1,291 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`valid template matches snapshot on initial render 1`] = `
<DocumentFragment>
<main
class="nhsuk-main-wrapper"
id="maincontent"
role="main"
>
<div
class="nhsuk-grid-row"
>
<div
class="nhsuk-grid-column-two-thirds"
>
<form
action="javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')"
>
<input
name="form-id"
readonly=""
type="hidden"
value="edit-template-name"
/>
<input
name="csrf_token"
readonly=""
type="hidden"
value="no_token"
/>
<input
name="templateId"
readonly=""
type="hidden"
value="template-123"
/>
<input
name="lockNumber"
readonly=""
type="hidden"
value="5"
/>
<div
class="nhsuk-form-group"
>
<h1
class="nhsuk-label-wrapper"
>
<label
class="nhsuk-label nhsuk-label--l"
for="name"
>
Edit template name
</label>
</h1>
<div
class="nhsuk-hint"
>
This will not be visible to recipients
</div>
<details
class="nhsuk-details nhsuk-u-margin-top-3"
>
<summary
class="nhsuk-details__summary"
>
<span
class="nhsuk-details__summary-text"
>
Naming your templates
</span>
</summary>
<div
class="nhsuk-details__text"
>
<p>
You should name your templates in a way that works best for your service or organisation.
</p>
<p>
Common template names include the:
</p>
<ul>
<li>
subject or reason for the message
</li>
<li>
intended audience for the template
</li>
<li>
version number of the template
</li>
</ul>
<p>
For example, 'Covid19 2025 - over 65s - version 3'
</p>
</div>
</details>
<input
class="nhsuk-input nhsuk-u-margin-bottom-2"
id="name"
name="name"
type="text"
value="Original Template Name"
/>
</div>
<div
class="nhsuk-form-group"
>
<button
aria-disabled="false"
class="nhsuk-button"
type="submit"
>
Save changes
</button>
<a
class="nhsuk-u-display-inline-block nhsuk-u-font-size-19 nhsuk-u-margin-left-3 nhsuk-u-padding-top-3"
data-testid="back-link-bottom"
href="/preview-letter-template/template-123"
>
Go back
</a>
</div>
</form>
</div>
</div>
</main>
</DocumentFragment>
`;

exports[`valid template renders errors when blank form is submitted and error state is returned 1`] = `
<DocumentFragment>
<main
class="nhsuk-main-wrapper"
id="maincontent"
role="main"
>
<div
aria-labelledby="error-summary-title"
class="nhsuk-error-summary"
role="alert"
tabindex="-1"
>
<h2
class="nhsuk-error-summary__title"
data-testid="error-summary"
id="error-summary-title"
>
There is a problem
</h2>
<ul
class="nhsuk-list nhsuk-error-summary__list"
>
<li>
<a
href="#name"
>
Enter a template name
</a>
</li>
</ul>
</div>
<div
class="nhsuk-grid-row"
>
<div
class="nhsuk-grid-column-two-thirds"
>
<form
action="javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')"
>
<input
name="form-id"
readonly=""
type="hidden"
value="edit-template-name"
/>
<input
name="csrf_token"
readonly=""
type="hidden"
value="no_token"
/>
<input
name="templateId"
readonly=""
type="hidden"
value="template-123"
/>
<input
name="lockNumber"
readonly=""
type="hidden"
value="5"
/>
<div
class="nhsuk-form-group nhsuk-form-group--error"
>
<h1
class="nhsuk-label-wrapper"
>
<label
class="nhsuk-label nhsuk-label--l"
for="name"
>
Edit template name
</label>
</h1>
<div
class="nhsuk-hint"
>
This will not be visible to recipients
</div>
<details
class="nhsuk-details nhsuk-u-margin-top-3"
>
<summary
class="nhsuk-details__summary"
>
<span
class="nhsuk-details__summary-text"
>
Naming your templates
</span>
</summary>
<div
class="nhsuk-details__text"
>
<p>
You should name your templates in a way that works best for your service or organisation.
</p>
<p>
Common template names include the:
</p>
<ul>
<li>
subject or reason for the message
</li>
<li>
intended audience for the template
</li>
<li>
version number of the template
</li>
</ul>
<p>
For example, 'Covid19 2025 - over 65s - version 3'
</p>
</div>
</details>
<span
class="nhsuk-error-message"
>
<span
class="nhsuk-u-visually-hidden"
>
Error:
</span>
Enter a template name
</span>
<input
class="nhsuk-input nhsuk-u-margin-bottom-2"
id="name"
name="name"
type="text"
/>
</div>
<div
class="nhsuk-form-group"
>
<button
aria-disabled="false"
class="nhsuk-button"
type="submit"
>
Save changes
</button>
<a
class="nhsuk-u-display-inline-block nhsuk-u-font-size-19 nhsuk-u-margin-left-3 nhsuk-u-padding-top-3"
data-testid="back-link-bottom"
href="/preview-letter-template/template-123"
>
Go back
</a>
</div>
</form>
</div>
</div>
</main>
</DocumentFragment>
`;
Loading
Loading