umbraco-unit-testing

Run deterministic Web Test Runner tests for Umbraco backoffice Lit extensions.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/1k-off/umbraco-observability-playground --skill umbraco-unit-testing-1k-off
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: umbraco-unit-testing
Source: https://github.com/1k-off/umbraco-observability-playground/tree/main/.agents/skills/umbraco-unit-testing
Command: npx skills add https://github.com/1k-off/umbraco-observability-playground --skill umbraco-unit-testing-1k-off

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the challenge of reliably testing Umbraco backoffice extension logic and Lit-based UI without slow, hard-to-reproduce end-to-end setups.

Core Features & Use Cases

  • Fast, isolated unit tests with @open-wc/testing: Validate context/state logic, rendering behavior, and shadow DOM output for Lit elements.
  • Two testing approaches: Use full Umbraco imports for context consumption and UUI rendering, or use mock-based imports for simpler logic-only tests.
  • Practical configuration guidance: Set up Web Test Runner (Playwright) plus import maps to correctly target Umbraco’s dist-cms package/lib structure.
  • Use case: Build and verify a backoffice dashboard extension where observable context updates correctly drive UI re-rendering.

Quick Start

Set up @open-wc/testing with Web Test Runner and configure your import maps so Umbraco backoffice Lit, context, and observable APIs resolve from dist-cms when running your *.test.ts files.

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 Umbraco backoffice extensions built with Lit?

To unit test Umbraco backoffice extensions built with Lit, use @open-wc/testing with Web Test Runner to validate context tokens, observable subscriptions, and shadow DOM rendering in isolation. You can choose full Umbraco imports or mock-based approaches for faster feedback.

Why do my Umbraco Lit module imports fail in Web Test Runner?

Umbraco Lit module imports fail in Web Test Runner when import maps do not correctly target the dist-cms package/lib structure. Configuring accurate import map paths ensures reliable module resolution for backoffice Lit, context, and observable APIs during test execution.

Can I use mock-based isolation instead of full Umbraco imports for testing?

Yes, you can use mock-based isolation instead of full Umbraco imports for testing simpler logic-only scenarios. This approach provides faster feedback by avoiding full context consumption and UUI rendering setups, while still validating core observable state and controller utilities.

What's the best way to test shadow DOM rendering and observable state in Umbraco?

The best way to test shadow DOM rendering and observable state in Umbraco is applying deterministic Web Test Runner workflows with @open-wc/testing. This verifies that observable context updates correctly drive UI re-rendering for Lit elements without slow end-to-end setups.

Do I need Playwright to run isolated component tests for Umbraco backoffice UI?

Yes, you need @web/test-runner-playwright to run isolated component tests for Umbraco backoffice UI. It satisfies the required tooling setup alongside @open-wc/testing, enabling fast and deterministic validation of Lit elements and context logic.