원클릭으로
write-tests
Guide for writing comprehensive tests for Ion Design System components using Jest + Angular Testing Library
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Guide for writing comprehensive tests for Ion Design System components using Jest + Angular Testing Library
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Guides creating new components for the Ion Design System. Use this skill whenever the user asks to create, add, or build a new Ion component, new DS component, or new design system component. This skill MUST be used even if the user just says "create a component" or "add a new component" without being explicit — if the context is the Ion repo, always invoke this skill. It enforces that existing Ion components are reused inside new ones instead of native HTML elements.
Guides cherry-picking commits from the main branch (Angular v21) to support/v19 or support/v8 in the Ion Design System. Use this skill whenever the user mentions cherry-pick, backport, porting a fix or feature to v19/v8/support branches, propagating changes between branches, or needs to apply a commit from main to an older branch.
Step-by-step guide to create a new Ion Design System component with all required files
Guide for creating Storybook stories for Ion Design System components
SOC 직업 분류 기준
| name | write-tests |
| description | Guide for writing comprehensive tests for Ion Design System components using Jest + Angular Testing Library |
Follow this guide to write comprehensive tests for an existing Ion component.
Determine which component needs tests. Read the component's .component.ts to understand:
input() signals and their types/defaultsoutput() signals.component.html)The test file should be at projects/ion/src/lib/<component>/<component>.component.spec.ts.
@if blocks)Use iteration when testing multiple values of the same input:
const sizes: Array<'sm' | 'md' | 'lg' | 'xl'> = ['sm', 'md', 'lg', 'xl'];
sizes.forEach((size) => {
it(`should render size: ${size}`, () => {
fixture.componentRef.setInput('size', size);
fixture.detectChanges();
const el = fixture.nativeElement.querySelector('button');
expect(el.classList.contains(`ion-btn-${size}`)).toBe(true);
});
});
it('should emit event', () => {
const spy = jest.fn();
component.ionOnClick.subscribe(spy);
fixture.detectChanges();
const el = fixture.nativeElement.querySelector('button');
el.click();
expect(spy).toHaveBeenCalled();
});
fixture.componentRef.setInput() to set signal inputsfixture.detectChanges() after changing inputsfixture.nativeElement.querySelector() for DOM queriesdocument.body.querySelector() for overlay/portal elements (dropdowns, modals, tooltips)[data-testid] attribute selectors for reliable queriesjest.fn() for spy/mock functionsnpx jest --testPathPattern=<component-name>
npx jest --testPathPattern=<component-name> --coverage