Testing Notes
-Unit Testing ・The testing of individual blocks of an application such as a class, function, or component.
-Integration Testing ・Testing a combination of units and ensuring they work together.
-E2E Testing ・Testing the entire application flow and ensuring it works as designed from start to finish
-What to test ・component renders ・component renders with props ・component renders with different states ・component reacting to events
-How to test 1. Render component 2. Find element rendered 3. Assert element (using expect with matcher) which will pass or fail
-RTL Queries ・find single element -getBy -queryBy -findBy ・find multiple elements -getAllBy -queryAllBy -findAllBy
-How to write tests
hoge.test.ts
describe(“testing”, () => { test(“renders correctly”, => { render(<Component/>) ….queries }) })