Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump @testing-library/jest-dom from 6.5.0 to 6.6.2 #482

Merged
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
17 changes: 12 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@babel/preset-env": "^7.26.0",
"@babel/preset-typescript": "^7.26.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/jest-dom": "^6.6.2",
"@types/atob": "^2.1.4",
"@types/btoa": "^1.2.5",
"@types/convict": "^6.1.6",
Expand Down Expand Up @@ -136,6 +136,7 @@
"jest": "^29.7.0",
"jsdom": "^25.0.1",
"lint-staged": "^15.2.10",
"outdent": "^0.8.0",
"postcss": "^8.4.47",
"postcss-load-config": "^6.0.1",
"postcss-loader": "^8.1.1",
Expand Down
232 changes: 116 additions & 116 deletions test/form/govuk-notify.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'

import { addDays, format } from 'date-fns'
import { outdent } from 'outdent'

import { createServer } from '~/src/server/index.js'
import {
Expand Down Expand Up @@ -29,121 +30,6 @@ const okStatusCode = 200
const redirectStatusCode = 302
const htmlContentType = 'text/html'

const dateNow = new Date()
const dateNowFormatted = `${format(dateNow, 'h:mmaaa')} on ${format(dateNow, 'd MMMM yyyy')}`

const fileExpiryDate = addDays(dateNow, 30)
const formattedExpiryDate = `${format(fileExpiryDate, 'h:mmaaa')} on ${format(fileExpiryDate, 'eeee d MMMM yyyy')}`

const formResults = `^ For security reasons, the links in this email expire at ${formattedExpiryDate}

Form received at ${dateNowFormatted}.

## Text field
\`\`\`
Text field
\`\`\`


## Multiline text field
\`\`\`
Multiline text field
\`\`\`


## Number field
\`\`\`
1
\`\`\`


## Date parts field
\`\`\`
2012-12-12
\`\`\`


## Month year field
\`\`\`
2012-12
\`\`\`


## Yes/No field
\`\`\`
yes
\`\`\`


## Email address field
\`\`\`
user@email.com
\`\`\`


## Telephone number field
\`\`\`
+447900000000
\`\`\`


## Telephone number field
\`\`\`
Address line 1, Address line 2, Town or city, CW1 1AB
\`\`\`


## Radios field
\`\`\`
privateLimitedCompany
\`\`\`


## Select field
\`\`\`
910400000
\`\`\`


## Autocomplete field
\`\`\`
910400044
\`\`\`


## Checkboxes field 1
\`\`\`
Shetland
\`\`\`


## Checkboxes field 2
\`\`\`
Arabian,Shire,Race
\`\`\`


## Checkboxes field 3 (number)
\`\`\`
1
\`\`\`


## Checkboxes field 4 (number)
\`\`\`
0,1
\`\`\`


## Upload your methodology statement
1 file uploaded (links expire ${formattedExpiryDate}):

* [test.pdf](https://test-designer.cdp-int.defra.cloud/file-download/5a76a1a3-bc8a-4bc0-859a-116d775c7f15)


[Download main form (CSV)](https://test-designer.cdp-int.defra.cloud/file-download/00000000-0000-0000-0000-000000000000)
`

const componentsPath = '/components/all-components'
const fileUploadPath = '/components/methodology-statement'
const summaryPath = '/components/summary'
Expand Down Expand Up @@ -225,6 +111,12 @@ describe('Submission journey test', () => {
jest.mocked(getFormMetadata).mockResolvedValue(fixtures.form.metadata)
jest.mocked(submit).mockResolvedValue(submitResponse)

const dateNow = new Date()
const dateNowFormatted = `${format(dateNow, 'h:mmaaa')} on ${format(dateNow, 'd MMMM yyyy')}`

const fileExpiryDate = addDays(dateNow, 30)
const formattedExpiryDate = `${format(fileExpiryDate, 'h:mmaaa')} on ${format(fileExpiryDate, 'eeee d MMMM yyyy')}`

// Components page
const res = await componentsPage()

Expand All @@ -243,7 +135,115 @@ describe('Submission journey test', () => {
emailAddress: 'enrique.chase@defra.gov.uk',
personalisation: {
subject: 'Form received: All components',
body: formResults
body: expect.stringContaining(outdent`
^ For security reasons, the links in this email expire at ${formattedExpiryDate}

Form received at ${dateNowFormatted}.

## Text field
\`\`\`
Text field
\`\`\`


## Multiline text field
\`\`\`
Multiline text field
\`\`\`


## Number field
\`\`\`
1
\`\`\`


## Date parts field
\`\`\`
2012-12-12
\`\`\`


## Month year field
\`\`\`
2012-12
\`\`\`


## Yes/No field
\`\`\`
yes
\`\`\`


## Email address field
\`\`\`
user@email.com
\`\`\`


## Telephone number field
\`\`\`
+447900000000
\`\`\`


## Telephone number field
\`\`\`
Address line 1, Address line 2, Town or city, CW1 1AB
\`\`\`


## Radios field
\`\`\`
privateLimitedCompany
\`\`\`


## Select field
\`\`\`
910400000
\`\`\`


## Autocomplete field
\`\`\`
910400044
\`\`\`


## Checkboxes field 1
\`\`\`
Shetland
\`\`\`


## Checkboxes field 2
\`\`\`
Arabian,Shire,Race
\`\`\`


## Checkboxes field 3 (number)
\`\`\`
1
\`\`\`


## Checkboxes field 4 (number)
\`\`\`
0,1
\`\`\`


## Upload your methodology statement
1 file uploaded (links expire ${formattedExpiryDate}):

* [test.pdf](https://test-designer.cdp-int.defra.cloud/file-download/5a76a1a3-bc8a-4bc0-859a-116d775c7f15)


[Download main form (CSV)](https://test-designer.cdp-int.defra.cloud/file-download/00000000-0000-0000-0000-000000000000)
`)
}
})

Expand Down
Loading