summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOliver <oliver@mohlin.dev>2025-05-08 08:58:06 +0200
committerTobias Järvelöv <tobias.jarvelov@mullvad.net>2025-05-27 21:38:04 +0200
commitb68c37741fa8f65e36033c8c647c4cc08410d1bc (patch)
tree1f9026143555c8d5b18aaf6e533fcc31fc7ef1d3
parent0be9d2e188229767b6c1906ec9274f0b0d92d3ad (diff)
downloadmullvadvpn-b68c37741fa8f65e36033c8c647c4cc08410d1bc.tar.xz
mullvadvpn-b68c37741fa8f65e36033c8c647c4cc08410d1bc.zip
Remove old settings test file
-rw-r--r--desktop/packages/mullvad-vpn/test/e2e/installed/state-dependent/settings.spec.ts89
1 files changed, 0 insertions, 89 deletions
diff --git a/desktop/packages/mullvad-vpn/test/e2e/installed/state-dependent/settings.spec.ts b/desktop/packages/mullvad-vpn/test/e2e/installed/state-dependent/settings.spec.ts
deleted file mode 100644
index 22d45ba81e..0000000000
--- a/desktop/packages/mullvad-vpn/test/e2e/installed/state-dependent/settings.spec.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-import { expect, Page, test } from '@playwright/test';
-import { execSync } from 'child_process';
-import os from 'os';
-import path from 'path';
-
-import { RoutePath } from '../../../../src/renderer/lib/routes';
-import { fileExists, TestUtils } from '../../utils';
-import { startInstalledApp } from '../installed-utils';
-
-function getAutoStartPath() {
- return path.join(os.homedir(), '.config', 'autostart', 'mullvad-vpn.desktop');
-}
-
-function autoStartPathExists() {
- return fileExists(getAutoStartPath());
-}
-
-let page: Page;
-let util: TestUtils;
-
-test.beforeAll(async () => {
- ({ page, util } = await startInstalledApp());
- await util.waitForRoute(RoutePath.main);
-});
-
-test.afterAll(async () => {
- await page.close();
-});
-
-test.describe('VPN Settings', () => {
- test('Auto-connect setting', async () => {
- // Navigate to the VPN settings view
- await page.click('button[aria-label="Settings"]');
- await util.waitForRoute(RoutePath.settings);
- await page.click('text=VPN settings');
- await util.waitForRoute(RoutePath.vpnSettings);
-
- // Find the auto-connect toggle
- const autoConnectToggle = page.getByText('Auto-connect').locator('..').getByRole('checkbox');
-
- // Check initial state
- const initialCliState = execSync('mullvad auto-connect get').toString().trim();
- expect(initialCliState).toMatch(/off$/);
- await expect(autoConnectToggle).toHaveAttribute('aria-checked', 'false');
-
- // Toggle auto-connect
- await autoConnectToggle.click();
-
- // Verify the setting was applied correctly
- await expect(autoConnectToggle).toHaveAttribute('aria-checked', 'true');
- const newCliState = execSync('mullvad auto-connect get').toString().trim();
- expect(newCliState).toMatch(/off$/);
- });
-
- test('Launch on startup setting', async () => {
- // Find the launch on start-up toggle
- const launchOnStartupToggle = page
- .getByText('Launch app on start-up')
- .locator('..')
- .getByRole('checkbox');
-
- // Check initial state
- const initialCliState = execSync('mullvad auto-connect get').toString().trim();
- expect(initialCliState).toMatch(/off$/);
- await expect(launchOnStartupToggle).toHaveAttribute('aria-checked', 'false');
- if (process.platform === 'linux') {
- expect(autoStartPathExists()).toBeFalsy();
- }
-
- // Toggle launch on start-up
- await launchOnStartupToggle.click();
-
- // Verify the setting was applied correctly
- await expect(launchOnStartupToggle).toHaveAttribute('aria-checked', 'true');
- if (process.platform === 'linux') {
- expect(autoStartPathExists()).toBeTruthy();
- }
- const newCliState = execSync('mullvad auto-connect get').toString().trim();
- expect(newCliState).toMatch(/on$/);
-
- await launchOnStartupToggle.click();
-
- // Toggle auto-connect back off
- // NOTE: This must be done to clean up the auto-start file
- // TODO: Reset GUI settings between all tests
- const autoConnectToggle = page.getByText('Auto-connect').locator('..').getByRole('checkbox');
- await autoConnectToggle.click();
- });
-});