Chiến lược kiểm thử từ Vitest/RTL, MSW, hooks/store đến Playwright E2E, accessibility và error resilience.
Nguyên lý 'The more your tests resemble the way your software is used, the more confidence they can give you' và quy tắc chọn Query.
Chặn request ở network boundary để kiểm thử Loading, Error, Empty và Success mà không cần bật backend thật.
Sử dụng renderHook, act() và test-isolation để kiểm thử các Custom Hooks phức tạp và kiểm tra logic chuyển đổi trạng thái của Zustand Store.
Cải thiện khả năng tiếp cận với semantic HTML, điều hướng bàn phím và thiết lập Error Boundary đa tầng.