Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
alec-hamilton-ons committed Jul 27, 2023
1 parent 8651933 commit 0fbb9b2
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"plugins": ["prettier"],
"extends": ["prettier"],
"env": {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"lint-staged": {
"*.js": [
"prettier --print-width 140 --single-quote --parser babylon --write",
"prettier --print-width 140 --single-quote --parser babel --write",
"eslint --fix",
"git add"
],
Expand Down Expand Up @@ -70,7 +70,6 @@
"@babel/runtime": "^7.14.6",
"abortcontroller-polyfill": "^1.2.3",
"autoprefixer": "10.4.14",
"babel-eslint": "^10.0.1",
"babel-plugin-istanbul": "^6.0.0",
"babelify": "^10.0.0",
"backstopjs": "^6.1.4",
Expand Down Expand Up @@ -142,5 +141,7 @@
"resolutions": {
"minimist": "^1.2.5"
},
"dependencies": {}
"dependencies": {
"@babel/eslint-parser": "^7.22.9"
}
}
20 changes: 9 additions & 11 deletions src/components/relationships/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import axe from '../../tests/helpers/axe';
import { renderComponent, templateFaker } from '../../tests/helpers/rendering';

const EXAMPLE_RELATIONSHIPS = {
playback: "Amanda Bloggs is Joe Bloggs' <em>…</em>",
playback: "Amanda Bloggs is Joe Bloggs' <strong>…</strong>",
name: 'relationship',
dontWrap: true,
legendIsQuestionTitle: true,
Expand All @@ -18,8 +18,8 @@ const EXAMPLE_RELATIONSHIPS = {
text: 'Grandparent',
},
attributes: {
'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is their <em>grandparents</em>',
'data-playback': "Amanda Bloggs is Joe Bloggs' <em>grandparents</em>",
'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is their <strong>grandparents</strong>',
'data-playback': "Amanda Bloggs is Joe Bloggs' <strong>grandparents</strong>",
},
},
{
Expand All @@ -29,8 +29,8 @@ const EXAMPLE_RELATIONSHIPS = {
text: 'Other relation',
},
attributes: {
'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is their <em>other relation</em>',
'data-playback': "Amanda Bloggs is Joe Bloggs' <em>other relation</em>",
'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is their <strong>other relation</strong>',
'data-playback': "Amanda Bloggs is Joe Bloggs' <strong>other relation</strong>",
},
},
{
Expand All @@ -41,8 +41,8 @@ const EXAMPLE_RELATIONSHIPS = {
description: 'Including foster child',
},
attributes: {
'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is <em>unrelated</em> to Joe Bloggs',
'data-playback': 'Amanda Bloggs is <em>unrelated</em> to Joe Bloggs',
'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is <strong>unrelated</strong> to Joe Bloggs',
'data-playback': 'Amanda Bloggs is <strong>unrelated</strong> to Joe Bloggs',
},
},
],
Expand Down Expand Up @@ -82,10 +82,8 @@ describe('macro: relationships', () => {
it('has the provided `playback` text', () => {
const $ = cheerio.load(renderComponent('relationships', EXAMPLE_RELATIONSHIPS));

const playbackContent = $('.ons-relationships__playback')
.html()
.trim();
expect(playbackContent).toBe("Amanda Bloggs is Joe Bloggs' <em>…</em>");
const playbackContent = $('.ons-relationships__playback').html().trim();
expect(playbackContent).toBe("Amanda Bloggs is Joe Bloggs' <strong>…</strong>");
});

it('has playback paragraph hidden initially', async () => {
Expand Down
57 changes: 37 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@
json5 "^2.2.2"
semver "^6.3.1"

"@babel/eslint-parser@^7.22.9":
version "7.22.9"
resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.22.9.tgz#75f8aa978d1e76c87cc6f26c1ea16ae58804d390"
integrity sha512-xdMkt39/nviO/4vpVdrEYPwXCsYIXSSAr6mC7WQsNIlGnuxKyKE7GZjalcnbSWiC4OXGNNN3UQPeHfjSC6sTDA==
dependencies:
"@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1"
eslint-visitor-keys "^2.1.0"
semver "^6.3.1"

"@babel/generator@^7.22.7", "@babel/generator@^7.22.9", "@babel/generator@^7.7.2":
version "7.22.9"
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.9.tgz#572ecfa7a31002fa1de2a9d91621fd895da8493d"
Expand Down Expand Up @@ -268,7 +277,7 @@
regenerator-runtime "^0.13.11"
v8flags "^3.1.1"

"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.5", "@babel/parser@^7.22.7", "@babel/parser@^7.7.0":
"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.5", "@babel/parser@^7.22.7":
version "7.22.7"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.7.tgz#df8cf085ce92ddbdbf668a7f186ce848c9036cae"
integrity sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==
Expand Down Expand Up @@ -980,7 +989,7 @@
"@babel/parser" "^7.22.5"
"@babel/types" "^7.22.5"

"@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2":
"@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8", "@babel/traverse@^7.7.2":
version "7.22.8"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.8.tgz#4d4451d31bc34efeae01eac222b514a77aa4000e"
integrity sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw==
Expand All @@ -996,7 +1005,7 @@
debug "^4.1.0"
globals "^11.1.0"

"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.5", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0":
"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.5", "@babel/types@^7.3.3", "@babel/types@^7.4.4":
version "7.22.5"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe"
integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==
Expand Down Expand Up @@ -1362,6 +1371,13 @@
jpeg-js "^0.4.2"
pngjs "^6.0.0"

"@nicolo-ribaudo/[email protected]":
version "5.1.1-v1"
resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129"
integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==
dependencies:
eslint-scope "5.1.1"

"@nodelib/[email protected]":
version "2.1.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
Expand Down Expand Up @@ -2202,18 +2218,6 @@ axios@^0.25.0:
dependencies:
follow-redirects "^1.14.7"

babel-eslint@^10.0.1:
version "10.1.0"
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"
integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==
dependencies:
"@babel/code-frame" "^7.0.0"
"@babel/parser" "^7.7.0"
"@babel/traverse" "^7.7.0"
"@babel/types" "^7.7.0"
eslint-visitor-keys "^1.0.0"
resolve "^1.12.0"

babel-jest@^27.5.1:
version "27.5.1"
resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444"
Expand Down Expand Up @@ -4478,6 +4482,14 @@ eslint-plugin-prettier@^5.0.0:
prettier-linter-helpers "^1.0.0"
synckit "^0.8.5"

[email protected]:
version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==
dependencies:
esrecurse "^4.3.0"
estraverse "^4.1.1"

eslint-scope@^7.2.0:
version "7.2.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.1.tgz#936821d3462675f25a18ac5fd88a67cc15b393bd"
Expand All @@ -4486,10 +4498,10 @@ eslint-scope@^7.2.0:
esrecurse "^4.3.0"
estraverse "^5.2.0"

eslint-visitor-keys@^1.0.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e"
integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==
eslint-visitor-keys@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==

eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1:
version "3.4.1"
Expand Down Expand Up @@ -4567,6 +4579,11 @@ esrecurse@^4.3.0:
dependencies:
estraverse "^5.2.0"

estraverse@^4.1.1:
version "4.3.0"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==

estraverse@^5.1.0, estraverse@^5.2.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
Expand Down Expand Up @@ -10330,7 +10347,7 @@ resolve.exports@^1.1.0:
resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.1.tgz#05cfd5b3edf641571fd46fa608b610dda9ead999"
integrity sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ==

resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.20.0, resolve@^1.3.3, resolve@^1.4.0:
resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.20.0, resolve@^1.3.3, resolve@^1.4.0:
version "1.22.2"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f"
integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==
Expand Down

0 comments on commit 0fbb9b2

Please sign in to comment.