Skip to content

Commit c9748e9

Browse files
authored
chore: Update kcd-scripts to 11.x (#962)
1 parent 0f8d912 commit c9748e9

26 files changed

+311
-327
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"jest-serializer-ansi": "^1.0.3",
5555
"jest-watch-select-projects": "^2.0.0",
5656
"jsdom": "^16.4.0",
57-
"kcd-scripts": "^7.5.3",
57+
"kcd-scripts": "^11.0.0",
5858
"typescript": "^4.1.2"
5959
},
6060
"eslintConfig": {

src/__node_tests__/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ test('works without a browser context on a dom node (JSDOM Fragment)', () => {
6666

6767
expect(dtl.getByLabelText(container, /username/i)).toMatchInlineSnapshot(`
6868
<input
69-
id="username"
69+
id=username
7070
/>
7171
`)
7272
expect(dtl.getByLabelText(container, /password/i)).toMatchInlineSnapshot(`
7373
<input
74-
id="password"
75-
type="password"
74+
id=password
75+
type=password
7676
/>
7777
`)
7878
})

src/__node_tests__/screen.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ test('the screen export throws a helpful error message when no global document i
44
expect(() =>
55
screen.getByText(/hello world/i),
66
).toThrowErrorMatchingInlineSnapshot(
7-
`"For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error"`,
7+
`For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error`,
88
)
99
})
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`getByLabelText query will throw the custom error returned by config.getElementError 1`] = `"My custom error: Unable to find a label with the text of: TEST QUERY"`;
3+
exports[`getByLabelText query will throw the custom error returned by config.getElementError 1`] = `My custom error: Unable to find a label with the text of: TEST QUERY`;
44

5-
exports[`getByText query will throw the custom error returned by config.getElementError 1`] = `"My custom error: Unable to find an element with the text: TEST QUERY. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible."`;
5+
exports[`getByText query will throw the custom error returned by config.getElementError 1`] = `My custom error: Unable to find an element with the text: TEST QUERY. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.`;

src/__tests__/ariaAttributes.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ test('`selected` throws on unsupported roles', () => {
55
expect(() =>
66
getByRole('textbox', {selected: true}),
77
).toThrowErrorMatchingInlineSnapshot(
8-
`"\\"aria-selected\\" is not supported on role \\"textbox\\"."`,
8+
`"aria-selected" is not supported on role "textbox".`,
99
)
1010
})
1111

@@ -14,7 +14,7 @@ test('`pressed` throws on unsupported roles', () => {
1414
expect(() =>
1515
getByRole('textbox', {pressed: true}),
1616
).toThrowErrorMatchingInlineSnapshot(
17-
`"\\"aria-pressed\\" is not supported on role \\"textbox\\"."`,
17+
`"aria-pressed" is not supported on role "textbox".`,
1818
)
1919
})
2020

@@ -23,7 +23,7 @@ test('`checked` throws on unsupported roles', () => {
2323
expect(() =>
2424
getByRole('textbox', {checked: true}),
2525
).toThrowErrorMatchingInlineSnapshot(
26-
`"\\"aria-checked\\" is not supported on role \\"textbox\\"."`,
26+
`"aria-checked" is not supported on role "textbox".`,
2727
)
2828
})
2929

@@ -32,7 +32,7 @@ test('`expanded` throws on unsupported roles', () => {
3232
expect(() =>
3333
getByRole('heading', {expanded: true}),
3434
).toThrowErrorMatchingInlineSnapshot(
35-
`"\\"aria-expanded\\" is not supported on role \\"heading\\"."`,
35+
`"aria-expanded" is not supported on role "heading".`,
3636
)
3737
})
3838

@@ -142,9 +142,9 @@ test('`selected: true` matches `aria-selected="true"` on supported roles', () =>
142142
'selected-listbox-option',
143143
])
144144

145-
expect(
146-
getAllByRole('rowheader', {selected: true}).map(({id}) => id),
147-
).toEqual(['selected-rowheader', 'selected-native-rowheader'])
145+
expect(getAllByRole('rowheader', {selected: true}).map(({id}) => id)).toEqual(
146+
['selected-rowheader', 'selected-native-rowheader'],
147+
)
148148

149149
expect(getAllByRole('treeitem', {selected: true}).map(({id}) => id)).toEqual([
150150
'selected-treeitem',
@@ -208,7 +208,7 @@ test('`level` throws on unsupported roles', () => {
208208
expect(() =>
209209
getByRole('button', {level: 3}),
210210
).toThrowErrorMatchingInlineSnapshot(
211-
`"Role \\"button\\" cannot have \\"level\\" property."`,
211+
`Role "button" cannot have "level" property.`,
212212
)
213213
})
214214

src/__tests__/base-queries-warn-on-invalid-container.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ describe('synchronous queries throw on invalid container type', () => {
8686
])('%s', (_queryName, query) => {
8787
expect(() =>
8888
query('invalid type for container', 'irrelevant text'),
89-
).toThrowErrorMatchingInlineSnapshot(
90-
`"Expected container to be an Element, a Document or a DocumentFragment but got string."`,
89+
).toThrowError(
90+
`Expected container to be an Element, a Document or a DocumentFragment but got string.`,
9191
)
9292
})
9393
})
@@ -120,8 +120,8 @@ describe('asynchronous queries throw on invalid container type', () => {
120120
queryOptions,
121121
waitOptions,
122122
),
123-
).rejects.toThrowErrorMatchingInlineSnapshot(
124-
`"Expected container to be an Element, a Document or a DocumentFragment but got string."`,
123+
).rejects.toThrowError(
124+
`Expected container to be an Element, a Document or a DocumentFragment but got string.`,
125125
)
126126
})
127127
})

0 commit comments

Comments
 (0)