component-fixtures

Create themed component fixtures for screenshot testing of VS Code UI widgets.

Updated Sep 3, 2026
One-click install
npx skills add https://github.com/az0512124155azz-sys/CodeForge --skill component-fixtures-az0512124155azz-sys
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: component-fixtures
Source: https://github.com/az0512124155azz-sys/CodeForge/tree/main/.github/skills/component-fixtures
Command: npx skills add https://github.com/az0512124155azz-sys/CodeForge --skill component-fixtures-az0512124155azz-sys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Visual regression testing of isolated UI components requires rendering widgets outside the full workbench, which is difficult when components depend on editor services, themes, and deep CSS ancestor selectors. This Skill guides you through building fixture files that render components in a shadow DOM with Dark and Light themes for programmatic screenshot capture. ## Core Features & Use Cases - Fixture Authoring: Create .fixture.ts files using defineThemedFixtureGroup and defineComponentFixture that auto-generate Dark/Light variants discovered by the Vite dev server. - Service Setup: Use createEditorServices to get a TestInstantiationService with base editor services pre-registered, plus mock services via additionalServices and the mock<T>() helper. - Component Adaptation Guidance: Refactor components to be fixture-friendly by decoupling CSS from ancestor selectors, injecting services via DI, exposing domNode, and disabling auto-focus for stable screenshots. - Use Case: You built a new chat input widget and need screenshot coverage. Write a fixture that registers the required services, renders the widget in Loading and Completed states, and capture both theme variants with the component explorer MCP tools. ## Quick Start Create a component fixture for my widget and screenshot it in both Dark and Light themes using the component explorer tools.

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, and the Vite dev server auto-discovers it via the glob src/**/*.fixture.ts.

How do I screenshot a component fixture with the component explorer?▼

Start the Component Explorer Server task, then use the mcp_component-exp_list_fixtures tool to see available fixtures and mcp_component-exp_screenshot to capture images. The explorer waits two animation frames, or for your render promise to resolve, before capturing.

Why does my component's CSS not apply inside a fixture?▼

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

How do I mock services in a component fixture?▼

Pass an additionalServices callback to createEditorServices and register implementations with reg.define or pre-built instances with reg.defineInstance. Create mocks using the mock<T>() helper from base/test/common/mock.js and override only the methods your component calls.

Why are my fixture screenshots flaky or flickering?▼

Flickering usually comes from reparenting DOM nodes after async waits, auto-focus behavior, or animations. Render the widget in its final DOM structure from the start, add a shouldAutoFocus option set to false in fixtures, and avoid moving widgets between parents.