Skip to content

[Toolkit] Add functional tests to render all Kit components usage codes (from their documentation), with a snapshot system - #2720

Merged
Kocal merged 5 commits into
symfony:2.xfrom
Kocal:toolkit/test-func-docs-code-examples
May 11, 2025
Merged

[Toolkit] Add functional tests to render all Kit components usage codes (from their documentation), with a snapshot system#2720
Kocal merged 5 commits into
symfony:2.xfrom
Kocal:toolkit/test-func-docs-code-examples

Conversation

@Kocal

@Kocal Kocal commented May 8, 2025

Copy link
Copy Markdown
Member
Q A
Bug fix? no
New feature? yes
Docs? no
Issues Fix #...
License MIT

This PR add snapshots testing for each Twig code blocks from src/Toolkit/kits/**/docs/components/*.md, to ensure that rendering is always good.

I don't think we will add visual testing, at least for now. Having snapshots tests and visual previews (on the website) feels convenient enough, but if someone has a super-simple solution, why not!)

I tagged the PR as a feature, not because the snapshots testing itself, but because I introduced a new service KitContextRunner. I needed something similar than the "hacks" from the website, but for tests.

@carsonbot carsonbot added Feature New Feature Toolkit Status: Needs Review Needs to be reviewed labels May 8, 2025
Comment thread .github/workflows/test.yaml Outdated
Comment thread src/Toolkit/tests/Fixtures/Kernel.php Outdated
Comment thread src/Toolkit/tests/Functional/ComponentsRenderingTest.php Outdated
@Kocal
Kocal force-pushed the toolkit/test-func-docs-code-examples branch 3 times, most recently from e861af1 to eb81e37 Compare May 8, 2025 12:35
@Kocal
Kocal force-pushed the toolkit/test-func-docs-code-examples branch from eb81e37 to 1b1c545 Compare May 8, 2025 12:55
…ra on PHP < 8.2, since it now supports PHP 8.1
@Kocal
Kocal requested review from kbond and smnandre May 8, 2025 17:48
@Kocal
Kocal merged commit abedbd1 into symfony:2.x May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New Feature Status: Needs Review Needs to be reviewed Toolkit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants