Skip to content

test: deflake j/k navigation e2e by asserting the active file - #31

Merged
danilrwx merged 1 commit into
mainfrom
fix-flaky-jk-nav-test
Aug 11, 2026
Merged

test: deflake j/k navigation e2e by asserting the active file#31
danilrwx merged 1 commit into
mainfrom
fix-flaky-jk-nav-test

Conversation

@danilrwx

Copy link
Copy Markdown
Owner

Description

The j and k scroll between files e2e compared raw scrollY offsets around the two j presses. The PR description above the diff renders asynchronously and shifts every section down, so between the presses the second j could re-anchor the file it was already on — and k from the first file is a no-op by design, leaving scrollY stuck at the captured offset until the poll timed out (failure in CI).

Assert the scroll spy's active file in the tree (.pt-tree-file.pt-active data-path) instead of pixel offsets, retrying the keypress until the spy reports the expected file. The scroll assertions that remain only check direction, not exact offsets.

Verified with --repeat-each=10, all green.

The test compared raw scrollY offsets around the two j presses, but the
PR description above the diff renders asynchronously and shifts every
section down, so the second j could re-anchor the first file and k then
had nowhere to go (k from the first file is a no-op by design).

Assert the scroll spy's active file in the tree instead, retrying the
keypress until the spy reports the expected file.

Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
@github-actions github-actions Bot added the test Tests (test:) label Aug 11, 2026
@danilrwx
danilrwx enabled auto-merge (squash) August 11, 2026 08:01
@danilrwx
danilrwx merged commit a166c04 into main Aug 11, 2026
4 checks passed
@danilrwx
danilrwx deleted the fix-flaky-jk-nav-test branch August 11, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Tests (test:)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant