style: format state subscriptions and their adopted controls

This commit is contained in:
Sameh Khamis committed 2026-09-13 05:43:05 -07:00
1 parent 45d97376d0
commit e0652b19f2
12 files changed
+299 -88

No files matched your search

+32 -9
View File
@@ -41,7 +41,9 @@ try {
);
await page.evaluate(() => {
window.__qaSceneState = [];
window.__godsEyeView.sceneDirector.subscribe((notification) => window.__qaSceneState.push(notification));
window.__godsEyeView.sceneDirector.subscribe((notification) =>
window.__qaSceneState.push(notification),
);
});
await page.click('[data-collapse-target="scene-panel"]');
await page.click('#scene-new-btn');
@@ -307,13 +309,31 @@ try {
document.querySelectorAll('#scene-select option').length > 0,
),
);
check('Scene subscriptions include current state and the completed native editing actions', await page.evaluate(() => {
const seen = window.__qaSceneState;
const types = new Set(seen.map(({ change }) => change?.type));
return seen[0].initial && Object.isFrozen(seen[0].state) &&
['scene-created', 'shot-captured', 'shot-renamed', 'shot-updated', 'project-exported', 'project-imported', 'shot-deleted', 'scene-deleted', 'run-event'].every((type) => types.has(type)) &&
seen.filter(({ change }) => change?.shot).every(({ change }) => Object.isFrozen(change.shot));
}));
check(
'Scene subscriptions include current state and the completed native editing actions',
await page.evaluate(() => {
const seen = window.__qaSceneState;
const types = new Set(seen.map(({ change }) => change?.type));
return (
seen[0].initial &&
Object.isFrozen(seen[0].state) &&
[
'scene-created',
'shot-captured',
'shot-renamed',
'shot-updated',
'project-exported',
'project-imported',
'shot-deleted',
'scene-deleted',
'run-event',
].every((type) => types.has(type)) &&
seen
.filter(({ change }) => change?.shot)
.every(({ change }) => Object.isFrozen(change.shot))
);
}),
);
const teardown = await page.evaluate(async () => {
const director = window.__godsEyeView.sceneDirector;
const controls = director._controls;
@@ -359,7 +379,10 @@ try {
'Late import completion cannot replace the disposed project or status',
teardown.sameProject && teardown.noLateStatus,
);
check('Scene subscriptions stop before late imports settle', teardown.stateStopped);
check(
'Scene subscriptions stop before late imports settle',
teardown.stateStopped,
);
check(
'Scene control interaction produces no uncaught browser errors',
errors.length === 0,