frontend-testing
Frontend testing guide — unit, integration, visual regression, accessibility, E2E for UI
Skill by amas-nghia
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/amas-nghia-frontend-testing
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: design, frontend, testing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/frontend-testing
What's inside
- Skill name
frontend-testing- Description
- Frontend testing guide — unit, integration, visual regression, accessibility, E2E for UI
- License
- MIT
- Instructions
- 113 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- name: "frontend-testing" does not match folder "skill-frontend-testing"
Files (2)
- SKILL.md
- package.json
SKILL.md (first lines)
# Frontend Testing Skill
## Thứ tự ưu tiên test
1. **E2E critical paths** — happy path của user journey quan trọng nhất
2. **Integration tests** — component với real API/state
3. **Unit tests** — utilities, hooks, pure functions
4. **Visual regression** — screenshot comparison cho UI quan trọng
5. **Accessibility audit** — automated a11y check
## Unit Test (Vitest / Jest)
### Cái gì nên unit test
- Pure utility functions (date format, validation, transform)
- Custom hooks (dùng `renderHook`)
- Complex business logic trong component
- Error boundary behavior
### Pattern
```ts
// Arrange
const input = { ... }
// Act
const result = fn(input)
// Assert
expect(result).toEqual(expected)
```
- Test behavior, không test implementation
- Mock tối thiểu — chỉ mock external services, không mock internal modules
- Tên test mô tả behavior: `"returns empty array when no results match"`
## Component / Integration Test (Testing Library)
```ts
render(<TaskCard task={mockTask} />)
// Query bằng role/label — không dùng test-id trừ khi cần
expect(screen.getByRole('heading', { name: 'Fix bug' })).toBeVisible()
await userEvent.click(screen.getByRole('button', { name: 'Claim' }))
expect(mockClaim).toHaveBeenCalledWith(taskId)
```
### Query priority (ưu tiên từ cao xuống thấp)
1. `getByRole` — accessible name
2. `getByLabelText` — form fields
3. `getByText` — visible text
4. `getByTestId` — last resort
## E2E Test (Playwright)
### Checklist viết test
- [ ] Test happy path trước
- [ ] Dùng `page.getByRole` thay selectors CSS
- [ ] Waitfor selector/network idle thay `sleep`
- [ ] Screenshot assertion cho visual-critical pages
- [ ] Test trên mobile viewport (375px) nếu có responsive
```ts
test('user can claim a task', async ({ page }) => {
await page.goto('/board')
await page.getByRole('button', { name: 'Claim' }).first().click()
await expect(page.getByText('In Progress')).toBeVisible()
})
```
### Tránh flaky tests
- Không hardcode timeout — dùng `waitForSelector` / `waitForResponse`
- Không test timing animations
- Isolate test data — mỗi test tự tạo data riêng hoặc reset state
## Visual Regression
- Screenshot các breakpoint: 375, 768, 1280, 1920
- Test cả light và dark mode nếu project có
- Chạy sau mỗi UI change đáng kể
- Review diff trước khi approve snapshot update
## Accessibility Testing
```ts
import { axe } from 'jest-axe'
const { container } = render(<Component />)
const results = await axe(container)
expect(results).toHaveNoViolations()
```
- Keyboard navigation: Tab qua tất cả interactive elements
- Screen reader test với VoiceOver (Mac) hoặc NVDA (Windows)
- Focus trap trong modal/dialog
## Coverage targets
| Loại | Minimum |
|---|---|
| Utility functions | 95% |
| Hooks | 85% |
| Components (branch) | 80% |
| Critical user paths (E2E) | 100% |
## Khi test fail
1. Reproduce locally trước khi sửa
2. Đọc error message đầy đủ
3. Kiểm tra xem test sai hay implementation sai
4. Không disable test — fix root cause
5. Nếu flaky: xác định race condition và fix bằng proper waitFrom amas-nghia/relayhq, MIT.
More from amas-nghia/relayhq
- 0.497score
tech-writing
amas-nghia
Technical writing and documentation skill — specs, runbooks, changelogs, meeting notes, ADRs
SkillCFreshness: C★ 2Claude Code +9 - 0.497score
backend-dev
amas-nghia
Backend development guide — API design, data modeling, business logic, security, performance
SkillCFreshness: C★ 2Claude Code +9 - 0.497score
frontend-dev
amas-nghia
Frontend development guide — UI implementation, component architecture, state management, performance
SkillCFreshness: C★ 2Claude Code +9 - 0.497score
project-management
amas-nghia
Project management skill — sprint planning, backlog grooming, risk management, reporting, stakeholder communication
SkillCFreshness: C★ 2Claude Code +9 - 0.497score
backend-testing
amas-nghia
Backend testing guide — unit, integration, API contract, database, load testing
SkillCFreshness: C★ 2Claude Code +9 - 0.497score
codebase-brain
amas-nghia
Codebase second brain workflow for AI agents — use repo maps and capability maps before deep code reads
SkillCFreshness: C★ 2Claude Code +9 - 0.497score
coordination
amas-nghia
Multi-agent coordination skill — task decomposition, dependency tracking, handoff protocol, conflict resolution
SkillCFreshness: C★ 2Claude Code +9 - 0.424score
bug-fix
amas-nghia
Root cause analysis and fix guide for bug tasks
SkillDFreshness: D★ 2Claude Code +9 - 0.424score
code-review
amas-nghia
Systematic code review guide for AI agents
SkillDFreshness: D★ 2Claude Code +9 - 0.424score
documentation
amas-nghia
Documentation writing guide for AI agents
SkillDFreshness: D★ 2Claude Code +9
Signals
- Stars
- 2
- Forks
- 0
- Open issues
- 1
- Last commit (this folder)
- May 5, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/amas-nghia/relayhq
- Website
- amas.gitbook.io/relayhq
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from amas-nghia
- 0.497score
backend-testing
amas-nghia
Backend testing guide — unit, integration, API contract, database, load testing
SkillCFreshness: C★ 2Claude Code +9 - 0.497score
backend-dev
amas-nghia
Backend development guide — API design, data modeling, business logic, security, performance
SkillCFreshness: C★ 2Claude Code +9 - 0.497score
codebase-brain
amas-nghia
Codebase second brain workflow for AI agents — use repo maps and capability maps before deep code reads
SkillCFreshness: C★ 2Claude Code +9 - 0.497score
coordination
amas-nghia
Multi-agent coordination skill — task decomposition, dependency tracking, handoff protocol, conflict resolution
SkillCFreshness: C★ 2Claude Code +9 - 0.497score
frontend-dev
amas-nghia
Frontend development guide — UI implementation, component architecture, state management, performance
SkillCFreshness: C★ 2Claude Code +9 - 0.497score
project-management
amas-nghia
Project management skill — sprint planning, backlog grooming, risk management, reporting, stakeholder communication
SkillCFreshness: C★ 2Claude Code +9
Cite this page
frontend-testing skill. Agent Mart. https://agentmart.dev/skills/amas-nghia-frontend-testing (last updated 2026-10-24)