Scaffolds unit tests and screenshot tests to establish visual and functional rendering baselines for views before refactoring.
59
68%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.agents/skills/ui-eng-vision-test-scaffolder/SKILL.mdThis subskill establishes the safety net of existing and new visual/functional tests before any codebase modifications occur, ensuring that no rendering or logical regressions are introduced during modernization.
Verify Existing Tests:
IndexedDBViews.test.ts
for IndexedDBViews.ts) under the target folder or test/unittests/.test/interactions/ or
test/goldens/) matching the visual component to verify layout and styling.Detect Sub-component Testing Gaps (Hybrid Files):
IDBDatabaseView but are scarce/missing for IDBDataView).Scaffold Missing Tests:
CategorizedBreakpointsSidebarPane.test.ts:
First run the test having renderElementIntoDOM with {includeCommonStyles: true} to ensure styles are applied.
The first run will generate the screenshot.
Now try removing {includeCommonStyles: true} to see if class is
adding the styles itself. If the test pass, keep the version without
{includeCommonStyles: true}. Otherwise, bring it back.
Screenshot tests are unittests that render either the full widget (if not migrated to the MVP architecture) or its view function (if already in MVP shape).
When testing view-separated components, prefer testing the View function (e.g., DEFAULT_VIEW) directly by passing mock state and callbacks.
Use assertScreenshot to capture and verify the visual output.
Example structure:
it('renders the view', async () => {
const target = document.createElement('div');
renderElementIntoDOM(target, {includeCommonStyles: true});
MyComponent.DEFAULT_VIEW(mockViewInput, undefined, target);
await assertScreenshot('my_component/base.png');
});Wait for confirmation:
Always detect the execution environment first to run tests successfully:
Detection: Triggered if the workspace path starts with /google/cog/ or
/google/src/.
Why it is required: Raw commands like npm run test or autoninja fail
because they lack Google cloudtop/virtualization wrapper configurations.
Resolution Steps:
Do not run npm run test or standard autoninja directly.
Leverage the Google-specific Cider testing script to compile and run tests in the cloud workspace:
python3 internal/infra/scripts/cider/init_workspace.py test /google/cog/cloud/username/workspace_name --test_filter=front_end/panels/application/IndexedDBViews.test.tsDetection: Triggered if in an open-source or local standard Chromium checkout without Cog paths.
Troubleshooting vpython3 / depot_tools errors:
Symptom: Command fails with vpython3: command not found or
python3_bin_reldir.txt not found.
Resolution Steps:
Export depot_tools path:
export PATH=$PATH:/path/to/depot_toolsInitialize the depot_tools binaries by running update/gclient help once from the checkout root:
update_depot_toolsExecute the tests:
npm run test -- front_end/panels/application/IndexedDBViews.test.tsSymptom: Running lint checks fails with: TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for scripts/eslint_rules/...
Resolution Steps:
Compile the custom eslint rules and build assets first so that Node can parse the rules:
npm run builddiv -> span).{includeCommonStyles: true}.Before reporting back or committing, re-read the instructions and verify:
184a74d
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.