You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Command _getByText_ looks for an element that has exactly the text that it has as parameter, and nothing more. If we want to look for element that <i>contains</i> the text, we could use a extra option:
669
+
Command _getByText_ looks for an element that has exactly the **same text** that it has as parameter, and nothing more. If we want to look for element that <i>contains</i> the text, we could use a extra option:
670
670
671
671
```js
672
672
constelement=screen.getByText(
@@ -687,15 +687,15 @@ There are situation where yet another form of the command _queryByText_ is usefu
687
687
We could eg. use the command to ensure that something <i>is not rendered</i> to the component:
688
688
689
689
```js
690
-
test('renders no shit', () => {
690
+
test('does not render this', () => {
691
691
constnote= {
692
692
content:'This is a reminder',
693
693
important:true
694
694
}
695
695
696
696
render(<Note note={note} />)
697
697
698
-
constelement=screen.queryByText('do not want this shit to be rendered')
698
+
constelement=screen.queryByText('do not want this thing to be rendered')
0 commit comments