KScript docs
EN

Components

Test a component

Run kscript check . from the site folder to catch invalid declarations and missing props. Put parsing, validation, and persistence logic in functions that can also be exercised by kscript test. A browser test should serve the project, open an actual page, perform the interaction, and assert what the visitor sees.

For a streamed action, wait for an intermediate value while the request is still pending, then assert the final state and run another action. For a portal, exercise its controls at the destination, trigger a redraw, and verify it disappears when the source is removed. For in-page navigation, test Back and Forward after query and hash changes. Keep a test for a rejected action or unauthorized field when the component writes data.