/behavior-testing:angular-component-testingfrom behavior-testing
Guides writing and reviewing Angular component/directive tests focused on public template behavior, inputs/outputs, forms, and accessibility. Rejects implementation-coupled probes and fixture internals.
Ships in behavior-testing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill for Angular component and directive test writing and review. Component tests should prove public template/API behavior, not directive internals, fixture state, or signal plumbing.
Before writing or reviewing Angular component or directive tests, read:
references/behavior-testing.mdreferences/component-testing.mdreferences/vitest-browser-testing.md when the suite uses Vitest Browser ModeIn addition to the shared references, reject:
fixture.componentInstance, private fields, internal signals, private methods, or directive instances when template-visible behavior can prove the same contract."set" in signal, typeof value.set, or rendering "writable"/"read-only" solely to prove a returned signal's internals. Enforce type-only contracts with TypeScript, not DOM tests.Use this rule when testing Angular helpers that return signals from directive or component state. A small probe directive or component is fine when it exposes public behavior through the template. It becomes a test smell when the probe exists only to inspect the returned signal object's runtime shape.
This kind of probe is implementation-coupled:
@Directive({
exportAs: "hostAttributeProbe",
selector: "[hostAttributeProbe]",
})
class HostAttributeProbeDirective {
readonly ariaLabel = hostAttribute("aria-label")
readonly labelText = computed(() => this.ariaLabel() ?? "missing")
readonly signalType = computed(() =>
"set" in this.ariaLabel ? "writable" : "read-only",
)
}
The labelText readout is useful because it proves behavior: the template
observes the host attribute value exposed by the helper. The signalType
readout is not useful because it proves only that the current returned object
lacks a .set property. That is a runtime shape assertion, not user-visible
behavior. It will fail if the helper is refactored to a different read-only
signal implementation while preserving the same public contract.
Prefer tests that assert the observable contract:
null.Do not render "writable" or "read-only" solely to test whether a signal has
.set. If the public contract is read-only because the helper returns
Signal<T>, enforce that with TypeScript type checking or type-level tests, not
a DOM assertion.
Run this against changed Angular component test files and justify or rewrite every hit:
rg -n "fixture\\.componentInstance|querySelector|childNodes|data-.*part|data-state|toHaveClass|\\\"set\\\" in|typeof .*\\.set|signalType|getByTestId" <test-files>
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub qualcomm/qualcomm-ui --plugin behavior-testing5 skills in this plugin
/angular-testingUse when writing, reviewing, or refactoring Angular tests for application behavior, services, routes, state, forms, pipes, or integration flows, especially when tests may assert implementation details instead of public outcomes./react-component-testingUse when writing, reviewing, or refactoring React component tests, especially tests for props, callbacks, controlled state, children, accessibility, form behavior, or multiple public component API variants./react-testingUse when writing, reviewing, or refactoring React tests for application behavior, hooks, routes, state, or integration flows, especially when tests may assert implementation details instead of public outcomes.Other plugins' skills for the same job