test: give the stand-in desktop bridge its version and platform

This commit is contained in:
Linus Rath
2026-11-03 08:54:05 +01:00
parent 2b48047bcc
commit 3b1fa089aa
3 changed files with 5 additions and 5 deletions
@@ -55,7 +55,7 @@ beforeEach(() => {
FakeBroadcastChannel.reset();
vi.stubGlobal('BroadcastChannel', FakeBroadcastChannel);
// The bridge makes pop-outs available without stubbing the display mode.
window.bulwarkDesktop = { windows: {} };
window.bulwarkDesktop = { version: 1, platform: 'win32', windows: {} };
stubLocks();
sessionStorage.clear();
heard = [];
+2 -2
View File
@@ -72,7 +72,7 @@ describe('state across windows', () => {
});
it('also runs in the desktop app\'s main window', async () => {
window.bulwarkDesktop = { windows: {} };
window.bulwarkDesktop = { version: 1, platform: 'win32', windows: {} };
stop = startWindowSync();
writeFromAnotherWindow('locale-storage', { locale: 'fr' });
await settle();
@@ -140,7 +140,7 @@ describe('the app-like behaviour', () => {
});
it('marks the page before the first paint when the bridge is there', () => {
window.bulwarkDesktop = {};
window.bulwarkDesktop = { version: 1, platform: 'win32' };
runBoot();
expect(document.documentElement.hasAttribute('data-desktop')).toBe(true);
});
+2 -2
View File
@@ -101,7 +101,7 @@ describe('popoutsAvailable', () => {
it('asks the bridge too: display-mode is `browser` in Electron', async () => {
stubDisplay({ standalone: false });
window.bulwarkDesktop = { windows: {} };
window.bulwarkDesktop = { version: 1, platform: 'win32', windows: {} };
expect(await available()).toBe(true);
});
@@ -168,7 +168,7 @@ describe('opening windows', () => {
it('leaves it to the bridge when the bridge opens windows, under the same name', async () => {
const { openMessageWindow } = await import('@/lib/popout/open');
const bridgeOpen = vi.fn();
window.bulwarkDesktop = { windows: { open: bridgeOpen } };
window.bulwarkDesktop = { version: 1, platform: 'win32', windows: { open: bridgeOpen } };
const open = vi.spyOn(window, 'open');
expect(openMessageWindow({ emailId: 'bridged' })).toBe(true);
expect(openMessageWindow({ emailId: 'bridged' })).toBe(true);