Tag: Test

0

Rerender jest-axe

render() rerender is used to simulate props changing. How to get rerender(): 1const {rerender} = render(<FavoriteNumber />); rerender() uses and passes parameters rerender() is u

0

Jest test methods

Format expect(A).ValidateItem() is used in React testing library and Jest to verify functionality. Expect() Assertion Summary 1 [Expect() Assertion Summary 2](https://www.w3cschool.cn/jest_cn/ jest

0

Methods to get DOM

Aria-label try not to use role and aria-label in css. It’s all about accessibility. aria-label="cancelbtn", will read cancelbtn directly. So aria-label is for reading. If there is no aria-

0

Render, debug

Simple reusable rendering method In this method, we pass in the component as a parameter: 12345function render(ui) { const div = document.createElement('div') ReactDOM.render(<Fa

0

Installation, config

Install 1npm install --save-dev @testing-library/dom After installation, the setupTests.js file will be generated under src. ​ unit test file location The unit test file can be placed in the s