summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOskar <oskar@mullvad.net>2025-09-02 15:00:10 +0200
committerOskar <oskar@mullvad.net>2025-09-05 11:47:01 +0200
commit4f055f07f509be353591c1654321170b7f6d1bd5 (patch)
tree2a96d2ab3102473f3a2212850d82342b57c25ca2
parent1ffdfcac7a100a55f108a6fce27e93e7a2199a9b (diff)
downloadmullvadvpn-4f055f07f509be353591c1654321170b7f6d1bd5.tar.xz
mullvadvpn-4f055f07f509be353591c1654321170b7f6d1bd5.zip
Use new ipc utility for mocked login test
-rw-r--r--desktop/packages/mullvad-vpn/test/e2e/mocked/login.spec.ts29
1 files changed, 8 insertions, 21 deletions
diff --git a/desktop/packages/mullvad-vpn/test/e2e/mocked/login.spec.ts b/desktop/packages/mullvad-vpn/test/e2e/mocked/login.spec.ts
index 46f2dcd6a0..fb868a639e 100644
--- a/desktop/packages/mullvad-vpn/test/e2e/mocked/login.spec.ts
+++ b/desktop/packages/mullvad-vpn/test/e2e/mocked/login.spec.ts
@@ -1,7 +1,6 @@
import { expect, test } from '@playwright/test';
import { Page } from 'playwright';
-import { DeviceEvent } from '../../../src/shared/daemon-rpc-types';
import { RoutesObjectModel } from '../route-object-models';
import { MockedTestUtils, startMockedApp } from './mocked-utils';
@@ -18,9 +17,9 @@ test.describe('Clear account history warnings', () => {
};
const logout = async () => {
- await util.sendMockIpcResponse<DeviceEvent>({
- channel: util.ipcEvents.account.device,
- response: { type: 'logged out', deviceState: { type: 'logged out' } },
+ await util.ipc.account.device.notify({
+ type: 'logged out',
+ deviceState: { type: 'logged out' },
});
await routes.login.waitForRoute();
@@ -40,20 +39,14 @@ test.describe('Clear account history warnings', () => {
});
const setAccountHistory = async () => {
- await util.sendMockIpcResponse({
- channel: util.ipcEvents.accountHistory[''],
- response: '1234123412341234',
- });
+ await util.ipc.accountHistory[''].notify('1234123412341234');
};
test('Should not warn about creating an account', async () => {
const accountHistoryItemButton = routes.login.getAccountHistoryItemButton();
await expect(accountHistoryItemButton).not.toBeVisible();
- await Promise.all([
- util.expectIpcCall(util.ipcEvents.account.create),
- routes.login.createNewAccount(),
- ]);
+ await Promise.all([util.ipc.account.create.expect(), routes.login.createNewAccount()]);
});
test('Should warn about creating an account', async () => {
@@ -68,10 +61,7 @@ test.describe('Clear account history warnings', () => {
await routes.login.createNewAccount();
- await Promise.all([
- util.expectIpcCall(util.ipcEvents.account.create),
- routes.login.confirmCreateNewAccount(),
- ]);
+ await Promise.all([util.ipc.account.create.expect(), routes.login.confirmCreateNewAccount()]);
});
test('Should warn about clearing account history', async () => {
@@ -90,14 +80,11 @@ test.describe('Clear account history warnings', () => {
await routes.login.clearAccountHistory();
await Promise.all([
- util.expectIpcCall(util.ipcEvents.accountHistory.clear),
+ util.ipc.accountHistory.clear.expect(),
routes.login.confirmClearAccountHistory(),
]);
- await util.sendMockIpcResponse({
- channel: util.ipcEvents.accountHistory[''],
- response: undefined,
- });
+ await util.ipc.accountHistory[''].notify(undefined);
await expect(accountHistoryItemButton).not.toBeVisible();
});
});