Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
gnapse authored Feb 2, 2022
2 parents b08cddb + 3094eb1 commit afdc230
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 8 deletions.
36 changes: 36 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,42 @@
"contributions": [
"doc"
]
},
{
"login": "MatanBobi",
"name": "Matan Borenkraout",
"avatar_url": "https://avatars.githubusercontent.com/u/12711091?v=4",
"profile": "https://matan.io",
"contributions": [
"platform"
]
},
{
"login": "yannbf",
"name": "Yann Braga",
"avatar_url": "https://avatars.githubusercontent.com/u/1671563?v=4",
"profile": "https://github.com/yannbf",
"contributions": [
"code"
]
},
{
"login": "IanVS",
"name": "Ian VanSchooten",
"avatar_url": "https://avatars.githubusercontent.com/u/4616705?v=4",
"profile": "https://github.com/IanVS",
"contributions": [
"code"
]
},
{
"login": "cbroeren",
"name": "Chantal Broeren",
"avatar_url": "https://avatars.githubusercontent.com/u/7499806?v=4",
"profile": "http://chantalbroeren.nl",
"contributions": [
"doc"
]
}
],
"repoHost": "https://github.com",
Expand Down
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
registry=http://registry.npmjs.org/
registry=https://registry.npmjs.org/
package-lock=false
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ const selectInput = getByTestId('select-number')
expect(textInput).toHaveValue('text')
expect(numberInput).toHaveValue(5)
expect(emptyInput).not.toHaveValue()
expect(selectInput).not.toHaveValue(['second', 'third'])
expect(selectInput).toHaveValue(['second', 'third'])
```

<hr />
Expand Down Expand Up @@ -1355,6 +1355,10 @@ Thanks goes to these people ([emoji key][emojis]):
</tr>
<tr>
<td align="center"><a href="http://tu4mo.com"><img src="https://avatars.githubusercontent.com/u/16735302?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tu4mo</b></sub></a><br /><a href="https://github.com/testing-library/jest-dom/commits?author=tu4mo" title="Documentation">📖</a></td>
<td align="center"><a href="https://matan.io"><img src="https://avatars.githubusercontent.com/u/12711091?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matan Borenkraout</b></sub></a><br /><a href="#platform-MatanBobi" title="Packaging/porting to new platform">📦</a></td>
<td align="center"><a href="https://github.com/yannbf"><img src="https://avatars.githubusercontent.com/u/1671563?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yann Braga</b></sub></a><br /><a href="https://github.com/testing-library/jest-dom/commits?author=yannbf" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/IanVS"><img src="https://avatars.githubusercontent.com/u/4616705?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ian VanSchooten</b></sub></a><br /><a href="https://github.com/testing-library/jest-dom/commits?author=IanVS" title="Code">💻</a></td>
<td align="center"><a href="http://chantalbroeren.nl"><img src="https://avatars.githubusercontent.com/u/7499806?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Chantal Broeren</b></sub></a><br /><a href="https://github.com/testing-library/jest-dom/commits?author=cbroeren" title="Documentation">📖</a></td>
</tr>
</table>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@babel/runtime": "^7.9.2",
"@types/testing-library__jest-dom": "^5.9.1",
"aria-query": "^4.2.2",
"aria-query": "^5.0.0",
"chalk": "^3.0.0",
"css": "^3.0.0",
"css.escape": "^1.5.1",
Expand Down
2 changes: 1 addition & 1 deletion src/to-be-checked.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function supportedRolesSentence() {
}

function supportedRoles() {
return Array.from(roles.keys()).filter(roleSupportsChecked)
return roles.keys().filter(roleSupportsChecked)
}

function roleSupportsChecked(role) {
Expand Down
5 changes: 5 additions & 0 deletions src/to-have-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ export function toHaveClass(htmlElement, ...params) {
const to = this.isNot ? 'not to' : 'to'
return getMessage(
this,
this.utils.matcherHint(
`${this.isNot ? '.not' : ''}.toHaveClass`,
'element',
this.utils.printExpected(expected.join(' ')),
),
`Expected the element ${to} have EXACTLY defined classes`,
expected.join(' '),
'Received',
Expand Down
4 changes: 2 additions & 2 deletions src/to-have-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {checkHtmlElement, getMessage, normalize, deprecate} from './utils'
// See algoritm: https://www.w3.org/TR/accname-1.1/#mapping_additional_nd_description
export function toHaveDescription(htmlElement, checkWith) {
deprecate(
'toBeInTheDOM',
'Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container.',
'toHaveDescription',
'Please use toHaveAccessibleDescription.',
)

checkHtmlElement(htmlElement, toHaveDescription, this)
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import redent from 'redent'
import {parse} from 'css'
import cssParse from 'css/lib/parse'
import isEqual from 'lodash/isEqual'

class GenericTypeError extends Error {
Expand Down Expand Up @@ -100,7 +100,7 @@ class InvalidCSSError extends Error {
}

function parseCSS(css, ...args) {
const ast = parse(`selector { ${css} }`, {silent: true}).stylesheet
const ast = cssParse(`selector { ${css} }`, {silent: true}).stylesheet

if (ast.parsingErrors && ast.parsingErrors.length > 0) {
const {reason, line} = ast.parsingErrors[0]
Expand Down

0 comments on commit afdc230

Please sign in to comment.