Skip to content

Commit 3ecbb0a

Browse files
author
Kent C. Dodds
committed
more progress
1 parent 9d5b32d commit 3ecbb0a

16 files changed

+504
-472
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dom-testing-library",
3-
"version": "0.0.0-semantically-released",
3+
"version": "4.0.0-alpha.0",
44
"description": "Simple and complete DOM testing utilities that encourage good testing practices.",
55
"main": "dist/index.js",
66
"module": "dist/dom-testing-library.esm.js",

src/__tests__/element-queries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ test('get throws a useful error message', () => {
8686
</div>"
8787
`)
8888
expect(() => getByRole('LucyRicardo')).toThrowErrorMatchingInlineSnapshot(`
89-
"Unable to find an element by role=LucyRicardo
89+
"Unable to find an element by [role=LucyRicardo]
9090
9191
<div>
9292
<div />

src/__tests__/misc.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {render} from './helpers/test-utils'
2+
import {queryByAttribute} from '..'
3+
4+
// we used to use queryByAttribute internally, but we don't anymore. Some people
5+
// use it as an undocumented part of the API, so we'll keep it around.
6+
test('queryByAttribute', () => {
7+
const {container} = render(
8+
'<div data-foo="bar"></div><div data-foo="rubar"></div>',
9+
)
10+
expect(queryByAttribute('data-foo', container, 'bar')).not.toBeNull()
11+
expect(queryByAttribute('blah', container, 'sup')).toBeNull()
12+
expect(() => queryByAttribute('data-foo', container, /bar/)).toThrow(
13+
/multiple/,
14+
)
15+
})

0 commit comments

Comments
 (0)