diff --git a/.github/skills/testing/SKILL.md b/.github/skills/testing/SKILL.md index 4a30a1dd58f..4e145f2956a 100644 --- a/.github/skills/testing/SKILL.md +++ b/.github/skills/testing/SKILL.md @@ -109,6 +109,8 @@ FAST tests are [Playwright](https://playwright.dev/) integration tests that run Fixture tests in `@microsoft/fast-element/test/declarative/fixtures` are the primary way to verify declarative template features. Each fixture is a self-contained test case with its own HTML, state, templates, and component definitions. +When changing declarative syntax, directive parsing, template generation, hydration behavior, or other user-authored template behavior, add or update a declarative fixture and exercise it in browser. Source-level parser tests may supplement narrow parsing edge cases, but they should not be the only coverage for syntax that users write in `entry.html` or `templates.html`. Use the local README files under `packages/fast-element/test/declarative/fixtures/` and each fixture category to choose the right fixture type and follow category-specific examples. + For a complete guide on creating fixtures — including how to write `entry.html`, `state.json`, `templates.html`, `main.ts`, and spec files — see: 📄 **[Writing Fixtures](../../../packages/fast-element/test/declarative/fixtures/WRITING_FIXTURES.md)** diff --git a/change/@microsoft-fast-element-1a06cb78-b971-48a9-8c9c-e3ff31fa0383.json b/change/@microsoft-fast-element-1a06cb78-b971-48a9-8c9c-e3ff31fa0383.json new file mode 100644 index 00000000000..e3b922630d8 --- /dev/null +++ b/change/@microsoft-fast-element-1a06cb78-b971-48a9-8c9c-e3ff31fa0383.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "Document declarative fixture testing guidance.", + "packageName": "@microsoft/fast-element", + "email": "7559015+janechu@users.noreply.github.com", + "dependentChangeType": "none" +} diff --git a/packages/fast-element/test/declarative/fixtures/WRITING_FIXTURES.md b/packages/fast-element/test/declarative/fixtures/WRITING_FIXTURES.md index fa09ce098da..92aaa4a0dbc 100644 --- a/packages/fast-element/test/declarative/fixtures/WRITING_FIXTURES.md +++ b/packages/fast-element/test/declarative/fixtures/WRITING_FIXTURES.md @@ -50,6 +50,14 @@ Fixtures are auto-discovered by scanning category directories for subdirectories --- +## When to add or update a fixture + +Use fixtures for changes to declarative syntax, directive parsing, template generation, hydration behavior, or other behavior that users express in `entry.html` or `templates.html`. Fixture coverage runs the generated template in a browser and catches integration issues that parser-only tests can miss. + +Source-level parser tests may still be useful for very narrow edge cases, but they should supplement fixture coverage rather than replace it. Use the local README files in this directory and each fixture category to choose the right fixture type, then add or update the matching fixture and assert the behavior from the fixture's Playwright spec. + +--- + ## fast-build.config.json Each fixture must include a `fast-build.config.json` file that tells the `@microsoft/fast-build` CLI where to find the fixture's source files and how to build them. The build script passes `--config=` to the CLI for each fixture.