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

chore: Update kcd-scripts to 11.x #962

Merged
merged 8 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from 5 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
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.`;
10 changes: 5 additions & 5 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 @@ -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