ui-component-tests

Guides writing and verifying Angular component specs, story snapshots, and end-to-end screen frames.

1|Updated Jan 14, 2024
One-click install
npx skills add https://github.com/Eyhenij/rt-tools --skill ui-component-tests-eyhenij
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ui-component-tests
Source: https://github.com/Eyhenij/rt-tools/tree/main/.claude/skills/ui-component-tests
Command: npx skills add https://github.com/Eyhenij/rt-tools --skill ui-component-tests-eyhenij

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Choosing the wrong verification method for a UI change leads to false confidence: a green spec says nothing about layout, and a green snapshot says nothing about why it diverged. This Skill provides ready-made patterns and a strict execution order for checking Angular kit components and application screens in the rt-tools repository. ## Core Features & Use Cases - Four complementary checks: maps each verification question (state, appearance, whole screen, computed values) to the right tool — Jest spec, story snapshot, end-to-end screen frame, or computed-style measurement. - Snapshot harness rules: codifies settled-frame waits, font and icon readiness, viewport widening for tall nodes, network cut-off, and evidence preservation for rare divergences. - Two-showcase workflow: documents the separate snapshot harnesses, commands, and reference directories for @rt-tools/ui-kit and @rt-tools/ui-kit-v2. - Use Case: After editing a component's padding, run the spec, re-take the story snapshot against the raised showcase, and confirm the change with a computed-value measurement instead of trusting a green test run. ## Quick Start Ask the assistant to write a spec and a snapshot story for a ui-kit component and explain which check confirms a layout edit.

Frequently Asked Questions about ui-component-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test an Angular component's visual appearance?

Use a story snapshot rather than a spec: add a story for each visible state, run the snapshot harness against an already raised showcase, and compare frames against stored references. A spec only confirms state, inputs, and outputs, not layout.

How do I verify a CSS or layout change in a component library?

Confirm a layout edit with a measurement of computed values such as padding, font size, and color on the showcase page. Snapshots show that something diverged, while the measurement answers what exactly moved.

Why does my Storybook snapshot fail intermittently?

Intermittent snapshot failures usually come from unsettled frames: fonts not loaded, animations still running, or a viewport substituted for content taller than the window. Wait for events rather than fixed timeouts and widen the window before shooting tall nodes.

What is the difference between ui-kit and ui-kit-v2 snapshot harnesses?

The two showcases are deliberately separate: ui-kit uses port 6006 and shoots the whole page, while ui-kit-v2 uses port 6007, shoots the [data-story-root] node, and supports a story sweep via test:stories:v2. Each has its own test-runner.ts and reference directory.

When should I use an end-to-end screen frame instead of a story snapshot?

Use an end-to-end screen frame to verify a whole application screen assembled from components, with its store, routes, and dictionaries. Story snapshots only cover a component in isolation and miss layout issues between components.