[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EBT17HGXM96RMX84A0AEHH":3,"skill-same:01M6EBT17HGXM96RMX84A0AEHH":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":46,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6EBT17HGXM96RMX84A0AEHH","react-testing",null,"Testing strategies with RTL and Jest\u002FVitest. Use when writing React component tests with React Testing Library, Jest, or Vitest. (triggers: **\u002F*.test.tsx, **\u002F*.spec.tsx, render, screen, userEvent, expect)","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Freact-testing\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"react","testing","react testing","vitest","screen","triggers","tests","strategies","jest","tsx","use","library","testing library","component","test","spec","writing","2026-11-10 10:12:30",false,"---\nname: react-testing\ndescription: 'Testing strategies with RTL and Jest\u002FVitest. Use when writing React component tests with React Testing Library, Jest, or Vitest. (triggers: **\u002F*.test.tsx, **\u002F*.spec.tsx, render, screen, userEvent, expect)'\n---\n\n# React Testing\n\n## **Priority: P2 (MAINTENANCE)**\n\nReliable tests focusing on user behavior.\n\n## Implementation Guidelines\n\n- **Standards**: Use **React Testing Library (RTL)** with **Vitest or Jest**. Follow the **Arrange-Act-Assert (AAA)** pattern.\n- **Selection**: Prefer **`getByRole`** \u002F **`findByRole`** to test accessibility. Use **`data-testid`** only as a fallback for complex UI.\n- **Interactions**: Use **`userEvent` (async)** instead of `fireEvent` to better simulate browser events (e.g., `await user.click(element)`).\n- **Asynchrony**: Use **`await screen.findBy*`** for elements that appear later. Use **`waitFor(() => ...)`** for complex non-element updates.\n- **Networking**: Mock all API calls with **Mock Service Worker (MSW)**. **Never call real APIs** in unit\u002Fintegration tests.\n- **Architecture**: **Test behavior**, not implementation. Avoid checking internal `state` or `props`. Ensure **100% of P0 flows** are covered.\n- **Mocks**: **Mock expensive third-party libraries** (e.g., `framer-motion`, `react-router`) or heavy assets to speed up tests.\n- **Visuals**: Use **Snapshot testing** sparingly for stable, small UI components. **Manual a11y checks** with `jest-axe`.\n\n## Anti-Patterns\n\n- **No Shallow Rendering**: Render full tree.\n- **No Testing Implementation Details**: Don't check `component.state`.\n- **No Wait**: Use `findBy`, avoid `waitFor` if possible.\n\n## References\n\nSee [references\u002FREFERENCE.md](references\u002FREFERENCE.md) for MSW API mocking, Context testing, form testing, and React Router patterns.\n\n## Code\n\n```tsx\ntest('submits form', async () => {\n  const user = userEvent.setup();\n  render(\u003CLoginForm \u002F>);\n\n  await user.type(screen.getByLabelText(\u002Femail\u002Fi), 'test@test.com');\n  await user.click(screen.getByRole('button', { name: \u002Flogin\u002Fi }));\n\n  expect(await screen.findByText(\u002Fwelcome\u002Fi)).toBeInTheDocument();\n});\n```\n\n","# React Testing\n\n## **Priority: P2 (MAINTENANCE)**\n\nReliable tests focusing on user behavior.\n\n## Implementation Guidelines\n\n- **Standards**: Use **React Testing Library (RTL)** with **Vitest or Jest**. Follow the **Arrange-Act-Assert (AAA)** pattern.\n- **Selection**: Prefer **`getByRole`** \u002F **`findByRole`** to test accessibility. Use **`data-testid`** only as a fallback for complex UI.\n- **Interactions**: Use **`userEvent` (async)** instead of `fireEvent` to better simulate browser events (e.g., `await user.click(element)`).\n- **Asynchrony**: Use **`await screen.findBy*`** for elements that appear later. Use **`waitFor(() => ...)`** for complex non-element updates.\n- **Networking**: Mock all API calls with **Mock Service Worker (MSW)**. **Never call real APIs** in unit\u002Fintegration tests.\n- **Architecture**: **Test behavior**, not implementation. Avoid checking internal `state` or `props`. Ensure **100% of P0 flows** are covered.\n- **Mocks**: **Mock expensive third-party libraries** (e.g., `framer-motion`, `react-router`) or heavy assets to speed up tests.\n- **Visuals**: Use **Snapshot testing** sparingly for stable, small UI components. **Manual a11y checks** with `jest-axe`.\n\n## Anti-Patterns\n\n- **No Shallow Rendering**: Render full tree.\n- **No Testing Implementation Details**: Don't check `component.state`.\n- **No Wait**: Use `findBy`, avoid `waitFor` if possible.\n\n## References\n\nSee [references\u002FREFERENCE.md](references\u002FREFERENCE.md) for MSW API mocking, Context testing, form testing, and React Router patterns.\n\n## Code\n\n```tsx\ntest('submits form', async () => {\n  const user = userEvent.setup();\n  render(\u003CLoginForm \u002F>);\n\n  await user.type(screen.getByLabelText(\u002Femail\u002Fi), 'test@test.com');\n  await user.click(screen.getByRole('button', { name: \u002Flogin\u002Fi }));\n\n  expect(await screen.findByText(\u002Fwelcome\u002Fi)).toBeInTheDocument();\n});\n```\n\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Freact-testing",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill react-testing",{"tool":56,"command":57},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill react-testing",{"tool":59,"command":60},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill react-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Freact-testing\u002FSKILL.md",true,[],[65,74,83,92,98,104],{"skillNo":66,"name":67,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":36},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[71,72,73],"model","model hierarchy","model hierarchy skill",{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":36},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[80,81,82],"MCP","zoom","zoom mcp",{"skillNo":84,"name":85,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":36},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[89,90,91,81],"sdk","zoom apps sdk","apps",{"skillNo":93,"name":94,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":36},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[94],{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":36},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[100],{"skillNo":105,"name":106,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":36},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[106]]