component-fixtures

Creates themed UI component fixtures for screenshot testing in VS Code workbench.

1|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/voidful/Aixlarity --skill component-fixtures-voidful
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-fixtures
Source: https://github.com/voidful/Aixlarity/tree/main/aixlarity-ide/.github/skills/component-fixtures
Command: npx skills add https://github.com/voidful/Aixlarity --skill component-fixtures-voidful

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building and verifying UI components in isolation is difficult when components depend on editor services, themes, and deep CSS ancestor selectors. This Skill guides you through creating component fixtures that render widgets in a shadow DOM environment for reliable visual screenshot testing. ## Core Features & Use Cases - Fixture Authoring: Create .fixture.ts files using defineThemedFixtureGroup and defineComponentFixture that automatically generate Dark and Light theme variants. - Service Mocking: Set up TestInstantiationService with pre-registered editor services and register mock implementations via additionalServices. - Component Adaptation Guidance: Refactor components to be fixture-friendly by decoupling CSS from ancestor selectors, injecting services via DI, and exposing domNode. - Use Case: You built a new chat widget and need visual regression screenshots. Write a fixture that renders the widget in empty, loading, and completed states, then capture screenshots with the component explorer MCP tools. ## Quick Start Create a component fixture for my new widget and screenshot it in both dark and light themes using the component explorer.

Frequently Asked Questions about component-fixtures

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

FAQPage Schema
How do I create a component fixture for screenshot testing?

Create a file ending in .fixture.ts under src/vs/workbench/test/browser/componentFixtures/ that exports a default defineThemedFixtureGroup. Each fixture uses defineComponentFixture with a render function that builds the widget inside the provided container.

How do I mock VS Code services in a component fixture?

Use createEditorServices to get a TestInstantiationService with base editor services pre-registered, then register additional services via the additionalServices callback. Create mock instances with the mock<T>() helper from base/test/common/mock.js and register them with reg.defineInstance.

Why does my fixture screenshot flicker or show wrong layout?

Flickering usually comes from reparenting DOM elements after async waits, which invalidates absolute positioning and triggers focus loss. Render the widget in-place with the correct DOM structure from the start instead of moving it between parents.

Why do my component styles not apply inside the fixture?

Fixtures render inside shadow DOM, so CSS rules scoped to deep ancestor selectors like .workbench .sidebar .my-view will not match. Recreate the expected ancestor class structure in the fixture, or refactor the component CSS to use self-contained selectors.

Can I render a component in its completed state without user interaction?

Yes, pass pre-filled data through the constructor or options to initialize the component directly into the completed state. For example, set isUsed: true and provide answer data on a question carousel model rather than simulating the full interaction flow.