Skip to content

Commit 1d832c0

Browse files
Update pleasantest to v2 (#1697)
Co-authored-by: Gerardo Rodriguez <[email protected]>
1 parent c08b0f9 commit 1d832c0

File tree

7 files changed

+319
-289
lines changed

7 files changed

+319
-289
lines changed

jest.setup.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { configureDefaults } from 'pleasantest';
2+
3+
configureDefaults({
4+
// Design intent doesn't require Level AAA conformance,
5+
// but we want to keep a baseline targetSize check
6+
user: { targetSize: 35 /* px */ },
7+
});

package-lock.json

Lines changed: 295 additions & 278 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"ltx": "3.0.0",
8585
"mini-css-extract-plugin": "1.6.2",
8686
"npm-run-all": "4.1.5",
87-
"pleasantest": "1.7.0",
87+
"pleasantest": "2.0.0",
8888
"postcss": "8.4.12",
8989
"postcss-inline-svg": "4.1.0",
9090
"postcss-loader": "4.3.0",
@@ -146,5 +146,10 @@
146146
"validate": "run-s build test lint:check type",
147147
"version": "changeset version && prettier --write .",
148148
"release": "npm run build && changeset publish"
149+
},
150+
"jest": {
151+
"setupFilesAfterEnv": [
152+
"./jest.setup.js"
153+
]
149154
}
150155
}

src/components/button-swap/button-swap.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ test(
125125
'Callback functions are called',
126126
withBrowser(async ({ utils, screen, user }) => {
127127
await utils.injectHTML(await componentMarkup());
128+
await loadGlobalCSS(utils);
128129

129130
const mockInitialCallback = jest.fn();
130131
const mockSwappedCallback = jest.fn();

src/components/comment/comment.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test(
4040
.toMatchInlineSnapshot(`
4141
article "Test author name said:"
4242
banner
43-
heading "Test author name said:"
43+
heading "Test author name said:" (level=3)
4444
contentinfo
4545
link "Permalink to Test author name’s Jan 1, 2000 comment"
4646
button "Reply"
@@ -63,7 +63,7 @@ test(
6363
expect(await getAccessibilityTree(form, { includeText: false }))
6464
.toMatchInlineSnapshot(`
6565
form "Reply to Test author name"
66-
heading "Reply to Test author name"
66+
heading "Reply to Test author name" (level=4)
6767
link "Markdown"
6868
textbox "Reply" (focused)
6969
↳ description: "Please be kind, courteous and constructive. You may use simple HTML or Markdown in your comments. All fields are required."

src/components/sky-nav/sky-nav.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ test(
3636
link "Home: Cloud Four"
3737
text "Home: Cloud Four"
3838
navigation "Main Menu"
39-
heading "Main Menu"
39+
heading "Main Menu" (level=2)
4040
text "Main Menu"
41-
button "Toggle Main Menu"
41+
button "Toggle Main Menu" (expanded=false)
4242
`);
4343

4444
await user.click(navButton);
@@ -53,9 +53,9 @@ test(
5353
link "Home: Cloud Four"
5454
text "Home: Cloud Four"
5555
navigation "Main Menu"
56-
heading "Main Menu"
56+
heading "Main Menu" (level=2)
5757
text "Main Menu"
58-
button "Toggle Main Menu" (focused)
58+
button "Toggle Main Menu" (expanded=true) (focused)
5959
list
6060
listitem
6161
link "What We Do"
@@ -102,7 +102,7 @@ test(
102102
link "Home: Cloud Four"
103103
text "Home: Cloud Four"
104104
navigation "Main Menu"
105-
heading "Main Menu"
105+
heading "Main Menu" (level=2)
106106
text "Main Menu"
107107
list
108108
listitem

src/components/subscribe/subscribe.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ describe('Subscription', () => {
6464
await initJS(utils);
6565

6666
expect(await getAccessibilityTree(page)).toMatchInlineSnapshot(`
67-
document
68-
heading "Never miss an article!"
67+
document "pleasantest"
68+
heading "Never miss an article!" (level=2)
6969
text "Never miss an article!"
7070
status
7171
text "Notifications have been turned off."
7272
button "Get notifications"
7373
link "Get Weekly Digests"
7474
text "Get Weekly Digests"
7575
form "Get Weekly Digests"
76-
heading "Get Weekly Digests"
76+
heading "Get Weekly Digests" (level=2)
7777
text "Get Weekly Digests"
7878
text "Email"
7979
textbox "Email"

0 commit comments

Comments
 (0)