Skip to content

refactor: split screenshot test fixtures from test_utils - #1669

Open
VLukiantsev wants to merge 1 commit into
chore/lint-non-ui-js-scriptsfrom
refactor/split-screenshot-test-utils
Open

VLukiantsev wants to merge 1 commit into
chore/lint-non-ui-js-scriptsfrom
refactor/split-screenshot-test-utils

Conversation

@VLukiantsev

@VLukiantsev VLukiantsev commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Split cmd/ui/screenshot_tests/test_utils.ts (1,064 lines) into cohesive Playwright mock fixture modules (mock_platform_fixtures.ts, mock_experiment_fixtures.ts, mock_work_unit_fixtures.ts) and a table-driven route setup helper in test_utils.ts.

Motivation & Context

Removing 16 duplicate route handler wrappers and splitting fixtures below 600 lines unblocks strict max-lines enforcement across UI test and screenshot files.

Key Changes

Modified/added 4 file(s):

  • cmd/ui/screenshot_tests/mock_experiment_fixtures.ts
  • cmd/ui/screenshot_tests/mock_platform_fixtures.ts
  • cmd/ui/screenshot_tests/mock_work_unit_fixtures.ts
  • cmd/ui/screenshot_tests/test_utils.ts

Assumptions

  • Preserving exported setupMockRoutes and setupScreenshotEnvironment signatures keeps all six *.screenshot.spec.ts files working with zero import edits — confirmed by repo-wide grep and TypeScript compilation — fixture data remains identical.

Verification & Testing

  • Prettier format:check, npm run lint, tsc --noEmit (tsconfig.json and tsconfig.spec.json), check_file_naming.py, and 315/315 Bazel tests passed via .githooks/pre-commit.

Related Issues / Bugs

  • None (part of automated linter and refactoring stack).

TAG=agy
CONV=ba8411ef-c093-4f45-950a-b3bc1899268c

Stack created with GitHub Stacks CLI • Give Feedback 💬

@VLukiantsev
VLukiantsev added this pull request to stack #1675 November 12, 2026 19:46

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the screenshot test utilities by extracting mock data into separate fixture files (mock_experiment_fixtures.ts, mock_platform_fixtures.ts, and mock_work_unit_fixtures.ts) and simplifying the route mocking logic in test_utils.ts using a centralized route map. One issue was identified in the mock platform fixtures where sessionExpiresAt is defined in seconds instead of milliseconds, which could cause mock sessions to be interpreted as expired in JavaScript/TypeScript environments.

@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch 2 times, most recently from 48f65ef to 5284998 Compare November 13, 2026 08:22
@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch from 5284998 to d545c5b Compare November 13, 2026 09:19
@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch 2 times, most recently from e02a1fc to e129983 Compare November 13, 2026 10:56
@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch from e129983 to 3239581 Compare November 13, 2026 11:58
@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch 3 times, most recently from 43cc6d0 to c9d4191 Compare November 13, 2026 14:12
@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch 2 times, most recently from 135bc74 to df5f21b Compare November 16, 2026 08:37
@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch from df5f21b to 2c7b568 Compare November 16, 2026 09:17
@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch from 2c7b568 to b12b8c7 Compare November 16, 2026 11:13
@VLukiantsev
VLukiantsev removed this pull request from stack #1675 November 16, 2026 11:16
@VLukiantsev
VLukiantsev added this pull request to stack #1702 November 16, 2026 11:16
@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch from b12b8c7 to 9dde612 Compare November 16, 2026 11:44
@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch from 9dde612 to fc5730d Compare November 16, 2026 12:36
@VLukiantsev
VLukiantsev marked this pull request as ready for review November 16, 2026 19:21
@github-actions
github-actions Bot requested a review from AntonTyb November 16, 2026 19:21
@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch 2 times, most recently from de3cc3e to ac15b73 Compare November 16, 2026 20:08
TAG=agy
CONV=ba8411ef-c093-4f45-950a-b3bc1899268c
@VLukiantsev
VLukiantsev force-pushed the refactor/split-screenshot-test-utils branch from ac15b73 to 8899aca Compare November 17, 2026 11:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant