umbraco-unit-testing

Set up unit testing for Umbraco backoffice extensions with @open-wc/testing.

4|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/albanistrefi/umbraco_CLI --skill umbraco-unit-testing-albanistrefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: umbraco-unit-testing
Source: https://github.com/albanistrefi/umbraco_CLI/tree/main/skills/testing/umbraco-unit-testing
Command: npx skills add https://github.com/albanistrefi/umbraco_CLI --skill umbraco-unit-testing-albanistrefi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building Umbraco backoffice extensions with Lit and observable state is hard to verify quickly without slow, end-to-end testing.

Core Features & Use Cases

  • Fast, isolated unit testing for Lit elements and observable-based state using @open-wc/testing.
  • Two testing paths: full Umbraco import-map wiring for realistic context consumption, or mock-based imports for simpler pure-logic tests.
  • Context-aware component tests that validate rendering, shadow DOM output, and reactivity when observable state changes.

Quick Start

Configure web-test-runner with @open-wc/testing and import maps (or local mocks), install Playwright chromium, then run your component and context tests via web-test-runner.

Frequently Asked Questions about umbraco-unit-testing

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

FAQPage Schema
How do I unit test Lit web components in the Umbraco backoffice?

Unit testing Lit web components in the Umbraco backoffice uses @open-wc/testing with web-test-runner to validate shadow DOM rendering, observable state changes, and context consumption in isolated environments.

Do I need Playwright to run isolated unit tests for Umbraco extensions?

Playwright is required for isolated unit testing of Umbraco extensions because web-test-runner relies on it to execute chromium browser tests for Lit elements and observable subscriptions.

What's the best way to test Umbraco context API consumption without full end-to-end testing?

Testing Umbraco context API consumption without end-to-end testing uses local mock-based imports for simpler pure-logic tests, or full Umbraco dist-cms import-map wiring for realistic context consumption validation.

How do I configure web-test-runner for Lit element rendering and observable state changes?

Configuring web-test-runner for Lit element rendering and observable state changes requires a root SKILL.md with YAML frontmatter, correct Umbraco dist-cms import-map paths or local mocks, and a deterministic test setup supporting Playwright execution.

Why do my Umbraco backoffice component tests fail when observable subscriptions change state?

Umbraco backoffice component tests fail on observable state changes when lacking a deterministic test setup with proper @open-wc/testing configuration and correct import-map paths for context consumption validation.

Can I use @open-wc/testing to validate shadow DOM output for Umbraco Lit elements?

@open-wc/testing validates shadow DOM output and reactivity for Umbraco Lit elements by testing rendering behavior and observable state changes in fast, isolated unit tests rather than slow end-to-end testing.