@@ -66,6 +66,7 @@ import React from 'react'
6666import  { createStore  } from  ' redux' 
6767import  { Provider  } from  ' react-redux' 
6868import  { render , fireEvent  } from  ' @testing-library/react' 
69+ import  ' @testing-library/jest-dom/extend-expect' 
6970import  { initialState , reducer  } from  ' ./reducer.js' 
7071import  Counter  from  ' ./counter.js' 
7172
@@ -89,15 +90,15 @@ function renderWithRedux(
8990test (' can render with redux with defaults' =>  {
9091 const  { getByTestId , getByText  } =  renderWithRedux (< Counter / > )
9192 fireEvent .click (getByText (' +' 
92-  expect (getByTestId (' count-value' . textContent ). toBe (' 1' 
93+  expect (getByTestId (' count-value' ). toHaveTextContent (' 1' 
9394})
9495
9596test (' can render with redux with custom initial state' =>  {
9697 const  { getByTestId , getByText  } =  renderWithRedux (< Counter / > , {
9798 initialState:  { count:  3  },
9899 })
99100 fireEvent .click (getByText (' -' 
100-  expect (getByTestId (' count-value' . textContent ). toBe (' 2' 
101+  expect (getByTestId (' count-value' ). toHaveTextContent (' 2' 
101102})
102103
103104test (' can render with redux with custom store' =>  {
@@ -107,8 +108,8 @@ test('can render with redux with custom store', () => {
107108 store,
108109 })
109110 fireEvent .click (getByText (' +' 
110-  expect (getByTestId (' count-value' . textContent ). toBe (' 1000' 
111+  expect (getByTestId (' count-value' ). toHaveTextContent (' 1000' 
111112 fireEvent .click (getByText (' -' 
112-  expect (getByTestId (' count-value' . textContent ). toBe (' 1000' 
113+  expect (getByTestId (' count-value' ). toHaveTextContent (' 1000' 
113114})
114115``` 
0 commit comments