From 7d02caaeb60f40c66d6482ee90dff28b739ec7a0 Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Mon, 16 Nov 2026 14:42:24 +0100 Subject: [PATCH] Support optional workspace chrome queries in native-page test fixture --- website/tests/cp-v2-workspace-chrome.test.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/tests/cp-v2-workspace-chrome.test.mjs b/website/tests/cp-v2-workspace-chrome.test.mjs index 61ba1572..17f6fc95 100644 --- a/website/tests/cp-v2-workspace-chrome.test.mjs +++ b/website/tests/cp-v2-workspace-chrome.test.mjs @@ -1,6 +1,6 @@ import test from 'node:test';import assert from 'node:assert/strict';import {readFileSync} from 'node:fs';import {runInNewContext} from 'node:vm'; test('all native workspaces put reload below content and hide routine status after load',async()=>{ - class Node{constructor(tag,text,cls){this.tag=tag;this.textContent=text;this.className=cls;this.children=[];this.style={};this.contentWindow={postMessage(){}};}append(...nodes){this.children.push(...nodes);}replaceChildren(...nodes){this.children=nodes;}setAttribute(){}remove(){}} + class Node{constructor(tag,text,cls){this.tag=tag;this.textContent=text;this.className=cls;this.children=[];this.style={};this.contentWindow={postMessage(){}};}append(...nodes){this.children.push(...nodes);}replaceChildren(...nodes){this.children=nodes;}setAttribute(){}querySelector(){return null;}remove(){}} const host=new Node('div'),window={addEventListener(){},removeEventListener(){}},el=(...args)=>new Node(...args); let source=readFileSync(new URL('../control-panel/public/cp-v2/cp-v2-native-services.mjs',import.meta.url),'utf8').replace(/^import[^\n]*\n/gm,'').replaceAll('export ',''); const mount=runInNewContext(source+';mountNativeService',{canSubmitDevRequest:()=>false,createCPV2Page:({tabs})=>{const root=new Node('section');root.append(tabs[0].content);return {root};},el,window,location:{origin:'https://cp.dunerealms.com'},URL,AbortController,setTimeout,clearTimeout});