Saved Snippets QA
Goal
Verify that saved snippets support the practice loop without risking user code, breaking mobile layout, or weakening dark-mode readability.
JavaScript Checks
- Open
/practice/javascript. - Edit the starter code and save it with a custom title.
- Confirm the snippet appears in the JavaScript snippets list.
- Save another snippet without a title and confirm a generated JavaScript title appears.
- Load a snippet when the editor has no unsaved changes.
- Edit the editor, load a different snippet, cancel the confirmation, and confirm current code remains.
- Load again and accept the confirmation.
- Delete a snippet, cancel once, then delete again and confirm.
- Delete all JavaScript snippets and confirm the empty state returns.
TypeScript Checks
- Open
/practice/typescript. - Save a valid TypeScript example.
- Confirm JavaScript snippets do not appear in the TypeScript list.
- Load the TypeScript snippet and run it.
- Confirm the TypeScript feedback panel still separates compiled feedback from runtime console output.
- Save an invalid TypeScript example as a snippet, load it, run it, and confirm feedback shows an error before runtime output.
- Delete the TypeScript snippets and confirm the empty state returns.
Storage Recovery Checks
Use DevTools Application storage for learning-studio.practice-snippets.v1.
- Clear the key and reload a practice page.
- Set the key to invalid JSON and reload.
- Set the key to a wrong version and reload.
- Set the key to a mixed list with one valid snippet and one invalid snippet.
- Confirm the page stays usable and only valid snippets render.
Responsive Checks
Check laptop, tablet, and mobile widths.
- The editor and console remain usable.
- The snippets panel stays secondary.
- The title input is full width on mobile.
- Save, load, and delete buttons wrap cleanly.
- Long snippet titles do not overflow cards.
- Code previews remain compact.
Theme Checks
Check light, dark, and system themes.
- Snippet panel background uses app tokens.
- Input text and placeholder remain readable.
- Empty state border is visible.
- Code previews remain readable.
- Status messages remain readable.
- Delete and load buttons keep contrast.
Regression Checks
Run:
npm run test
npm run typecheck
npm run build
Manual smoke:
- Copy code still works.
- Copy console still works.
- Copy TypeScript feedback still works.
- Tab and Shift Tab still edit code correctly.
- Alt Down still duplicates line or selected block.
- Console caps still show truncation notice.