@@ -115,7 +115,7 @@ expect.extend({toBeInTheDocument, toHaveClass})
115
115
` @testing-library/jest-dom ` can work with any library or framework that returns
116
116
DOM elements from queries. The custom matcher examples below demonstrate using
117
117
` document.querySelector ` and
118
- [ dom-testing-library ] ( https://github.com/kentcdodds /dom-testing-library ) for
118
+ [ DOM Testing Library ] ( https://github.com/testing-library /dom-testing-library ) for
119
119
querying DOM elements.
120
120
121
121
### ` toBeDisabled `
@@ -151,7 +151,7 @@ expect(document.querySelector('[data-testid="input"]')).toBeDisabled()
151
151
expect (document .querySelector (' a' )).not .toBeDisabled ()
152
152
```
153
153
154
- ##### Using dom-testing-library
154
+ ##### Using DOM Testing Library
155
155
156
156
``` javascript
157
157
expect (getByTestId (container, ' button' )).toBeDisabled ()
@@ -196,7 +196,7 @@ expect(document.querySelector('[data-testid="empty"]').toBeEmpty()
196
196
expect (document .querySelector (' [data-testid="not-empty"]' ).not .toBeEmpty ()
197
197
` ` `
198
198
199
- ##### Using dom-testing-library
199
+ ##### Using DOM Testing Library
200
200
201
201
` ` ` javascript
202
202
expect (queryByTestId (container, ' empty' )).toBeEmpty ()
@@ -234,7 +234,7 @@ expect(nonExistantElement).not.toBeInTheDocument()
234
234
expect (detachedElement).not .toBeInTheDocument ()
235
235
` ` `
236
236
237
- ##### Using dom-testing-library
237
+ ##### Using DOM Testing Library
238
238
239
239
` ` ` javascript
240
240
expect (
@@ -286,7 +286,7 @@ expect(queryByTestId('aria-invalid-value')).toBeInvalid()
286
286
expect (queryByTestId (' aria-invalid-false' )).not .toBeInvalid ()
287
287
` ` `
288
288
289
- ##### Using dom-testing-library
289
+ ##### Using DOM Testing Library
290
290
291
291
` ` ` javascript
292
292
expect (getByTestId (container, ' no-aria-invalid' )).not .toBeInvalid ()
@@ -349,7 +349,7 @@ expect(
349
349
).toBeRequired ()
350
350
` ` `
351
351
352
- ##### Using dom-testing-library
352
+ ##### Using DOM Testing Library
353
353
354
354
` ` ` javascript
355
355
expect (getByTestId (container, ' required-input' )).toBeRequired ()
@@ -397,7 +397,7 @@ expect(queryByTestId('aria-invalid-value')).not.toBeValid()
397
397
expect (queryByTestId (' aria-invalid-false' )).toBeValid ()
398
398
` ` `
399
399
400
- ##### Using dom-testing-library
400
+ ##### Using DOM Testing Library
401
401
402
402
` ` ` javascript
403
403
expect (getByTestId (container, ' no-aria-invalid' )).toBeValid ()
@@ -459,7 +459,7 @@ expect(
459
459
).not .toBeVisible ()
460
460
` ` `
461
461
462
- ##### Using dom-testing-library
462
+ ##### Using DOM Testing Library
463
463
464
464
` ` ` javascript
465
465
expect (getByText (container, ' Zero Opacity Example' )).not .toBeVisible ()
@@ -501,7 +501,7 @@ expect(descendant).not.toContainElement(ancestor)
501
501
expect (ancestor).not .toContainElement (nonExistantElement)
502
502
` ` `
503
503
504
- ##### Using dom-testing-library
504
+ ##### Using DOM Testing Library
505
505
506
506
` ` ` javascript
507
507
const {queryByTestId } = render (/* Rendered HTML */ )
@@ -540,7 +540,7 @@ expect(document.querySelector('[data-testid="parent"]')).toContainHTML(
540
540
)
541
541
` ` `
542
542
543
- ##### Using dom-testing-library
543
+ ##### Using DOM Testing Library
544
544
545
545
` ` ` javascript
546
546
expect (getByTestId (container, ' parent' )).toContainHTML (
@@ -588,7 +588,7 @@ expect(button).toHaveAttribute('type', 'submit')
588
588
expect (button).not .toHaveAttribute (' type' , ' button' )
589
589
` ` `
590
590
591
- ##### Using dom-testing-library
591
+ ##### Using DOM Testing Library
592
592
593
593
` ` ` javascript
594
594
const button = getByTestId (container, ' ok-button' )
@@ -638,7 +638,7 @@ expect(deleteButton).not.toHaveClass('btn-link')
638
638
expect (noClasses).not .toHaveClass ()
639
639
` ` `
640
640
641
- ##### Using dom-testing-library
641
+ ##### Using DOM Testing Library
642
642
643
643
` ` ` javascript
644
644
const deleteButton = getByTestId (container, ' delete-button' )
@@ -680,7 +680,7 @@ input.blur()
680
680
expect (input).not .toHaveFocus ()
681
681
` ` `
682
682
683
- ##### Using dom-testing-library
683
+ ##### Using DOM Testing Library
684
684
685
685
` ` ` javascript
686
686
const input = queryByTestId (container, ' element-to-focus' )
@@ -811,7 +811,7 @@ expect(button).not.toHaveStyle(`
811
811
` )
812
812
` ` `
813
813
814
- ##### Using dom-testing-library
814
+ ##### Using DOM Testing Library
815
815
816
816
` ` ` javascript
817
817
const button = getByTestId (container, ' delete-button' )
@@ -866,7 +866,7 @@ expect(element).toHaveTextContent(/content$/i) // to use case-insentive match
866
866
expect (element).not .toHaveTextContent (' content' )
867
867
` ` `
868
868
869
- ##### Using dom-testing-library
869
+ ##### Using DOM Testing Library
870
870
871
871
` ` ` javascript
872
872
const element = getByTestId (container, ' text-content' )
@@ -920,7 +920,7 @@ expect(emptyInput).not.toHaveValue()
920
920
expect (selectInput).not .toHaveValue ([' second' , ' third' ])
921
921
` ` `
922
922
923
- ##### Using dom-testing-library
923
+ ##### Using DOM Testing Library
924
924
925
925
` ` ` javascript
926
926
const {getByTestId } = render (/* Rendered HTML */ )
@@ -972,8 +972,8 @@ expect(document.querySelector('.cancel-button')).toBeTruthy()
972
972
973
973
## Inspiration
974
974
975
- This whole library was extracted out of Kent C. Dodds' [dom-testing-library ][],
976
- which was in turn extracted out of [react-testing-library ][].
975
+ This whole library was extracted out of Kent C. Dodds' [DOM Testing Library ][],
976
+ which was in turn extracted out of [React Testing Library ][].
977
977
978
978
The intention is to make this available to be used independently of these other
979
979
libraries, and also to make it more clear that these other libraries are
@@ -990,9 +990,7 @@ here!
990
990
> confidence they can give you.][guiding-principle]
991
991
992
992
This library follows the same guiding principles as its mother library
993
- [dom-testing-library][]. Go
994
- [check them out](https://github.com/kentcdodds/dom-testing-library#guiding-principles)
995
- for more details.
993
+ [DOM Testing Library][]. Go [check them out][guiding-principle] for more details.
996
994
997
995
Additionally, with respect to custom DOM matchers, this library aims to maintain
998
996
a minimal but useful set of them, while avoiding bloating itself with merely
@@ -1093,4 +1091,4 @@ MIT
1093
1091
https://img.shields.io/twitter/url/https/github.com/testing-library/jest-dom.svg?style=social
1094
1092
[emojis]: https://allcontributors.org/docs/en/emoji-key
1095
1093
[all-contributors]: https://github.com/all-contributors/all-contributors
1096
- [guiding-principle]: https://twitter .com/kentcdodds/status/977018512689455106
1094
+ [guiding-principle]: https://testing-library .com/docs/guiding-principles
0 commit comments