一键导入
create-test
// Generate or update unit tests for a component following project testing conventions
// Generate or update unit tests for a component following project testing conventions
Audit a component for WCAG AA accessibility compliance
Adopt breaking changes from fundamental-styles into Angular components
Audit existing code against project conventions and Angular 21+ best practices
Build a reactive form with @fundamental-ngx/platform form components, FormGroup wiring, validation, and error states
Build a page layout using fd-dynamic-page or fdp-dynamic-page — collapsing header, subheader, content area, footer, and optional tabs
Build a @fundamental-ngx/platform data table with FdpTableDataSource, sorting, filtering, pagination, and row selection
| name | create-test |
| description | Generate or update unit tests for a component following project testing conventions |
| argument-hint | ["component-path"] |
| context | fork |
| agent | general-purpose |
If $ARGUMENTS is empty, ask the user for a component path before proceeding.
Read the component file at $ARGUMENTS. Extract:
input() / input.required() and @Input() declarations with types and defaultsoutput() and @Output() declarations with event typesmodel() declarationsLook for an existing .spec.ts file alongside the component. If found, read it and identify:
Structure:
describe block per componentdescribe for each feature group (inputs, outputs, interactions, a11y)it descriptions should be user-focused: "should display label when label input is set"Signal inputs:
fixture.componentRef.setInput('inputName', value) — never assign directlyfixture.detectChanges() after setting inputsImports:
*Module classesTest components:
MenuTestComponent, not TestComponentWhat to test:
model()) update in both directionsWhat NOT to test:
Generate the complete test file content. If updating an existing file, show only the additions/changes needed.
yarn format
nx run <library>:test --testfile=<spec-file> --skip-nx-cache
Format the code first, then run tests. Report test results. If failures occur, diagnose and fix.