mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-05 16:16:49 +00:00
test: give the stand-in desktop bridge its version and platform
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user