From ef20ab021796b44c28253cddfd14d45c57bcec35 Mon Sep 17 00:00:00 2001 From: Atlas Development Worker Date: Tue, 1 Dec 2026 12:17:05 +0000 Subject: [PATCH] Wait through Context floor grid replacement in acceptance --- PlotLine.Tests/Browser/context-saved-data-development.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlotLine.Tests/Browser/context-saved-data-development.cjs b/PlotLine.Tests/Browser/context-saved-data-development.cjs index ab097260..d16b1d81 100644 --- a/PlotLine.Tests/Browser/context-saved-data-development.cjs +++ b/PlotLine.Tests/Browser/context-saved-data-development.cjs @@ -31,7 +31,7 @@ let session,stage='login'; await a.waitForFunction(w=>document.querySelector('iframe')?.contentWindow.PlotDirectorMapWorkspace?.document.features[0].width===w,savedWidth);await a.waitForTimeout(300); assert.equal(reads.filter(r=>r.path==='/SpatialContext/Floor').length,0);assert.equal(reads.filter(r=>r.page===c).length,0,'project-wide geometry does not refresh unrelated Overview');assert.deepEqual(await snapshot(),before); stage='failed save does not invalidate';reads.length=0;const failed=await p.evaluate(async()=>{const doc=structuredClone(PlotDirectorMapWorkspace.document);doc.map.revision=-1;const token=document.querySelector('[name=__RequestVerificationToken]').value;return (await fetch('/Maps/Save',{method:'POST',headers:{'Content-Type':'application/json','RequestVerificationToken':token},body:JSON.stringify(doc)})).status;});assert(failed>=400);await a.waitForTimeout(400);assert.equal(reads.length,0); - stage='floor layout persistence and viewport retention';await session.goto('/FloorPlans/Edit/'+plan);await p.locator('[data-toolbox-tab=floors]').click();const floorWidth=p.locator('[data-floor-width]').first();await floorWidth.evaluate(e=>{for(let node=e.parentElement;node;node=node.parentElement)if(node.tagName==='DETAILS')node.open=true;});const savedFloorWidth=Number(await floorWidth.inputValue())+1;await floorWidth.fill(String(savedFloorWidth));reads.length=0;await Promise.all([p.waitForResponse(r=>r.url().includes('/FloorPlans/SaveLayout')&&r.status()===200),p.locator('[data-save-layout-button]').first().click()]);await a.waitForFunction(w=>Number(document.querySelector('[data-floor-grid]').dataset.gridWidth)===w,savedFloorWidth);await a.waitForTimeout(300);assert.equal(reads.filter(r=>r.path==='/SpatialContext/Map').length,0);assert.equal(reads.filter(r=>r.page===b||r.page===c).length,0);assert.deepEqual(await snapshot(),before); + stage='floor layout persistence and viewport retention';await session.goto('/FloorPlans/Edit/'+plan);await p.locator('[data-toolbox-tab=floors]').click();const floorWidth=p.locator('[data-floor-width]').first();await floorWidth.evaluate(e=>{for(let node=e.parentElement;node;node=node.parentElement)if(node.tagName==='DETAILS')node.open=true;});const savedFloorWidth=Number(await floorWidth.inputValue())+1;await floorWidth.fill(String(savedFloorWidth));reads.length=0;await Promise.all([p.waitForResponse(r=>r.url().includes('/FloorPlans/SaveLayout')&&r.status()===200),p.locator('[data-save-layout-button]').first().click()]);stage='floor saved waiting for Context width';await a.waitForFunction(w=>Number(document.querySelector('[data-floor-grid]')?.dataset.gridWidth)===w,savedFloorWidth);stage='floor relevant refresh assertions';await a.waitForTimeout(300);assert.equal(reads.filter(r=>r.path==='/SpatialContext/Map').length,0);assert.equal(reads.filter(r=>r.page===b||r.page===c).length,0);stage='floor viewport retention assertion';assert.deepEqual(await snapshot(),before); stage='held location saved-data update';await session.goto('/Locations/Edit/'+place);await p.locator('[name=Description]').fill('Saved description after refresh');await p.locator('form.pd-record-form button[type=submit]').first().click();await p.waitForURL('**/Locations/Details/*');await b.locator('[data-context-pane="0"]').getByText('Saved description after refresh',{exact:true}).waitFor();assert.equal(await b.evaluate(()=>document.querySelector('[data-context-workspace]').contextController.position.sceneId),sceneId); stage='date-only save targets Overview and preserves book isolation';await session.goto('/Scenes/SceneDetailsEditor?sceneId='+sceneId);const exact=await p.locator('[name=TimeModeID] option').evaluateAll(options=>options.find(o=>/exact/i.test(o.textContent))?.value);assert(exact);await p.locator('[name=TimeModeID]').selectOption(exact);await p.locator('[name=StartDateTime]').fill('2030-05-06T10:00');reads.length=0;await Promise.all([p.waitForResponse(r=>r.url().includes('/Scenes/SaveSceneDetails')&&r.status()===200),p.getByRole('button',{name:'Save details',exact:true}).click()]);await b.waitForFunction(()=>document.querySelector('[data-context-pane="1"]').textContent.includes('2030'));await b.waitForTimeout(300);assert.equal(reads.filter(r=>r.page===a||r.page===c).length,0,'date-only save does not refresh spatial or other-book panes'); stage='book-scoped intent and isolation';await session.goto('/Scenes/Edit/'+sceneId);reads.length=0;await session.post('/Scenes/SaveScenePurpose',{SceneID:sceneId,ScenePurposeNotes:'Saved acceptance purpose',SceneOutcomeNotes:'Saved acceptance outcome'});await b.waitForTimeout(700);assert.equal(reads.filter(r=>r.page===c).length,0);assert.equal(reads.filter(r=>r.page===a).length,0,'intent does not refresh spatial panes');