test(desktop): make operator grid check direction-independent - #6744
test(desktop): make operator grid check direction-independent#6744roseonlineownz-lab wants to merge 1 commit into
Conversation
|
Could a maintainer approve the Actions run for this external-fork PR? It is a one-line, test-only stabilization: the Desktop operator-grid test no longer assumes LTR column order, while retaining the same-row / next-row layout checks. This was isolated from the unrelated broker-contract PR #6742 CI failure. No runtime, transport, or product behavior changes. |
Chessing234
left a comment
There was a problem hiding this comment.
the reasoning is right — column direction isn't a product invariant and a test shouldn't pin it — but i think the replacement asserts something weaker than what you actually want, and the pr leaves the interesting question unanswered.
the new assertion no longer checks "distinct columns".
expect(Math.abs(secondBox.x - firstBox.x)).toBeGreaterThan(1);that passes for any two elements more than one pixel apart horizontally, including two controls stacked in the same grid column with slightly different insets, or a layout that collapsed to one column and offset the second control by a margin. the stated intent is "the first two controls occupy distinct columns on the same row"; a non-overlap assertion says that directly and is still direction-agnostic:
const [left, right] = [firstBox, secondBox].sort((a, b) => a.x - b.x);
expect(left.x + left.width).toBeLessThanOrEqual(right.x + 1);that fails if they share a column and stays green under RTL. the < 1 same-row and next-row assertions around it are already the right shape.
what actually flipped the order? the pr says the failure is deterministic on #6742, whose diff is SDK-only. so something in the smoke environment renders this grid right-to-left, and neither the pr nor the test says what — a locale, a dir attribute, a browser default. if the answer is "the app is being rendered RTL in that job", that's worth knowing on its own, because it means every other x-coordinate assertion in the e2e suite is a latent failure of the same kind and this one just happened to be hit first. if the answer is "we don't know", relaxing the assertion makes a green run that nobody can explain, which is the failure mode where the next occurrence costs the same investigation again.
either way, one line in the test naming the reason it must not assume LTR would keep the next person from tightening it back.
Why
The Desktop Smoke E2E failure on broker PR #6742 is unrelated to its SDK-only diff. The deterministic failure is an LTR-only assertion in
workflow-local-controls.spec.ts: it requires the second operator button to have a larger x-coordinate than the first.The component deliberately uses a two-column CSS grid. Column direction is not a product invariant; the test should verify that the first two controls occupy distinct columns on the same row and that the third starts the next row.
Change
Replace the directional x-order assertion with a non-zero horizontal-separation assertion. Existing same-row and next-row assertions remain unchanged.
Evidence
buzz-sdkbroker files; it does not touch Desktop UI or E2E code.workflow-local-controls.spec.ts:297: first x=1132.00, second x=1093.48.No runtime, pairing, install, or merge action was performed.