Load remote UI on intent and preserve synchronous host hooks
This commit is contained in:
@@ -38,3 +38,13 @@ test('eager shell and Settings definitions load before app state and defer readi
|
||||
const views=readFileSync(join(__dirname,'views-core.js'),'utf8');
|
||||
assert.ok(views.includes('async function renderSettings()'));
|
||||
});
|
||||
|
||||
test('remote facade preserves synchronous no-session and loaded changed hooks',()=>{
|
||||
const source=app.match(/\/\* Remote facade \*\/([\s\S]*?)\/\* End remote facade \*\//)?.[1];
|
||||
assert.ok(source,'remote facade is present');
|
||||
const context=require('node:vm').createContext({window:{},Lazy:{proxy:()=>({}),onLoad(){}}});
|
||||
require('node:vm').runInContext(source+';globalThis.api=Remote;',context);
|
||||
assert.equal(context.api.changed(),undefined);
|
||||
let calls=0;context.window.YT={Remote:{changed:()=>{calls++;return 'sync';}}};
|
||||
assert.equal(context.api.changed(),'sync');assert.equal(calls,1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user