feat(frontend): add /form-test route to drive form components from the URL#10202
Open
BacLuc wants to merge 1 commit into
Open
feat(frontend): add /form-test route to drive form components from the URL#10202BacLuc wants to merge 1 commit into
BacLuc wants to merge 1 commit into
Conversation
…e URL
Add a dev-only route that renders a single ecamp form component selected
via the URL, so the form components can be driven and asserted on with
Playwright (or by hand) in isolation - without needing a camp, login or
API data.
/form-test/:component e.g. /form-test/ETextField
?props=<json> props passed to the component
?value=<json> initial v-model value
The view auto-discovers all form base components (E*.vue) via
import.meta.glob, renders the chosen one wrapped in EForm, and exposes
the live v-model value in [data-testid="form-test-model"] (the component
itself is under [data-testid="form-test-subject"]). Visiting /form-test
without a component lists the available ones. The route is gated behind
FEATURE_DEVELOPER like /controls but needs no auth, since the base
components work standalone.
Includes an example Playwright spec (e2e) showing how to assert on a
component's v-model after interacting with it (ETextField, ECheckbox).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: BacLuc <lucius.bachmann@clubpage.ch>
Contributor
Author
|
The same for api components is also in progress. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a dev-only route that renders a single ecamp form component selected via the URL, so the form components can be driven and asserted on with Playwright (or by hand) in isolation - without needing a camp, login or API data.
/form-test/:component e.g. /form-test/ETextField
?props= props passed to the component
?value= initial v-model value
The view auto-discovers all form base components (E*.vue) via import.meta.glob, renders the chosen one wrapped in EForm, and exposes the live v-model value in [data-testid="form-test-model"] (the component itself is under [data-testid="form-test-subject"]). Visiting /form-test without a component lists the available ones. The route is gated behind FEATURE_DEVELOPER like /controls but needs no auth, since the base components work standalone.
Includes an example Playwright spec (e2e) showing how to assert on a component's v-model after interacting with it (ETextField, ECheckbox).