Tests and budgets
Test every component in every state, catch visual changes with screenshots, and give each route a size budget the build enforces.
- Recommended 4
Recommended
Test every state of every data view
APP-54Write a component test for each state of each data view. Fake the network at the request level, and find elements by role and name.
Compare screenshots of every component state
APP-55Take a screenshot of every catalogue story at a phone and a desktop width, in light and dark mode. Fail the build when one changes without a new baseline.
Give each route a size budget
APP-56Give the first screen and each route its own budget for compressed JavaScript, and fail the build when a change goes over it.
Load heavy parts when they are needed
APP-57Load each route, and each widget over 20 kB compressed, such as a chart, an editor or a map, only when someone opens it.
Read this with
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/app-ui/tests-and-budgets">Agent Wranglers web app interface playbook</a>. In code you write, add a comment next to it with the same link.