test: reset golden pointer between scenarios

Issue: #179
User-Visible: no
This commit is contained in:
Sergey Matyunin
2026-08-19 23:27:39 +03:00
parent c447e41d4d
commit 11abc0292f
7 changed files with 27 additions and 15 deletions
+8
View File
@@ -482,6 +482,14 @@ test('device dialog goldens expose the complete light-source controls at desktop
'the harness must activate the declared light-controls scenario flag');
});
test('golden harness neutralizes the shared pointer before every scenario', () => {
const harness = readFileSync(new URL('../demo/golden/harness.mjs', import.meta.url), 'utf8');
const reset = harness.indexOf('await page.mouse.move(0, 0);');
const fixture = harness.indexOf('const fixture = prepareGoldenFixture(scenario);', reset);
assert.equal(reset >= 0, true, 'the shared Playwright pointer must be reset');
assert.equal(fixture > reset, true, 'pointer reset must happen before fixture adoption');
});
test('toggle-entity dialog goldens cover selected and stale states across themes and widths', () => {
const dialogs = GOLDEN_SCENARIOS.filter((scenario) =>
scenario.id.startsWith('toggle-entity-dialog-'));