Skip to content

Commit

Permalink
chore: Update kcd-scripts to 11.x (#962)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Jun 8, 2021
1 parent 0f8d912 commit c9748e9
Show file tree
Hide file tree
Showing 26 changed files with 311 additions and 327 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"jest-serializer-ansi": "^1.0.3",
"jest-watch-select-projects": "^2.0.0",
"jsdom": "^16.4.0",
"kcd-scripts": "^7.5.3",
"kcd-scripts": "^11.0.0",
"typescript": "^4.1.2"
},
"eslintConfig": {
Expand Down
6 changes: 3 additions & 3 deletions src/__node_tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ test('works without a browser context on a dom node (JSDOM Fragment)', () => {

expect(dtl.getByLabelText(container, /username/i)).toMatchInlineSnapshot(`
<input
id="username"
id=username
/>
`)
expect(dtl.getByLabelText(container, /password/i)).toMatchInlineSnapshot(`
<input
id="password"
type="password"
id=password
type=password
/>
`)
})
Expand Down
2 changes: 1 addition & 1 deletion src/__node_tests__/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ test('the screen export throws a helpful error message when no global document i
expect(() =>
screen.getByText(/hello world/i),
).toThrowErrorMatchingInlineSnapshot(
`"For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error"`,
`For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error`,
)
})
4 changes: 2 additions & 2 deletions src/__tests__/__snapshots__/get-by-errors.js.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

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"`;
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`;

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."`;
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.`;
16 changes: 8 additions & 8 deletions src/__tests__/ariaAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test('`selected` throws on unsupported roles', () => {
expect(() =>
getByRole('textbox', {selected: true}),
).toThrowErrorMatchingInlineSnapshot(
`"\\"aria-selected\\" is not supported on role \\"textbox\\"."`,
`"aria-selected" is not supported on role "textbox".`,
)
})

Expand All @@ -14,7 +14,7 @@ test('`pressed` throws on unsupported roles', () => {
expect(() =>
getByRole('textbox', {pressed: true}),
).toThrowErrorMatchingInlineSnapshot(
`"\\"aria-pressed\\" is not supported on role \\"textbox\\"."`,
`"aria-pressed" is not supported on role "textbox".`,
)
})

Expand All @@ -23,7 +23,7 @@ test('`checked` throws on unsupported roles', () => {
expect(() =>
getByRole('textbox', {checked: true}),
).toThrowErrorMatchingInlineSnapshot(
`"\\"aria-checked\\" is not supported on role \\"textbox\\"."`,
`"aria-checked" is not supported on role "textbox".`,
)
})

Expand All @@ -32,7 +32,7 @@ test('`expanded` throws on unsupported roles', () => {
expect(() =>
getByRole('heading', {expanded: true}),
).toThrowErrorMatchingInlineSnapshot(
`"\\"aria-expanded\\" is not supported on role \\"heading\\"."`,
`"aria-expanded" is not supported on role "heading".`,
)
})

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

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

expect(getAllByRole('treeitem', {selected: true}).map(({id}) => id)).toEqual([
'selected-treeitem',
Expand Down Expand Up @@ -208,7 +208,7 @@ test('`level` throws on unsupported roles', () => {
expect(() =>
getByRole('button', {level: 3}),
).toThrowErrorMatchingInlineSnapshot(
`"Role \\"button\\" cannot have \\"level\\" property."`,
`Role "button" cannot have "level" property.`,
)
})

Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/base-queries-warn-on-invalid-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ describe('synchronous queries throw on invalid container type', () => {
])('%s', (_queryName, query) => {
expect(() =>
query('invalid type for container', 'irrelevant text'),
).toThrowErrorMatchingInlineSnapshot(
`"Expected container to be an Element, a Document or a DocumentFragment but got string."`,
).toThrowError(
`Expected container to be an Element, a Document or a DocumentFragment but got string.`,
)
})
})
Expand Down Expand Up @@ -120,8 +120,8 @@ describe('asynchronous queries throw on invalid container type', () => {
queryOptions,
waitOptions,
),
).rejects.toThrowErrorMatchingInlineSnapshot(
`"Expected container to be an Element, a Document or a DocumentFragment but got string."`,
).rejects.toThrowError(
`Expected container to be an Element, a Document or a DocumentFragment but got string.`,
)
})
})
Loading

0 comments on commit c9748e9

Please sign in to comment.