diff --git a/client/playwright.config.ts b/client/playwright.config.ts index 80679e8f..f6871a03 100644 --- a/client/playwright.config.ts +++ b/client/playwright.config.ts @@ -42,7 +42,7 @@ export default defineConfig({ webServer: { stdout: process.env.CI ? 'pipe' : 'ignore', - command: `${!process.env.CI ? 'sudo ' : ''}./AdGuardHome --local-frontend -v -c /tmp/AdGuard.temp.e2e.yaml `, + command: `${!process.env.CI ? 'sudo ' : ''}./AdGuardHome --local-frontend -v -c /tmp/AdGuard.temp.e2e.yaml`, url: 'http://127.0.0.1:3000', cwd: '..', reuseExistingServer: !process.env.CI, diff --git a/client/src/actions/install.ts b/client/src/actions/install.ts index ea9b0e22..6dc4d5b6 100644 --- a/client/src/actions/install.ts +++ b/client/src/actions/install.ts @@ -50,8 +50,9 @@ export const checkConfig = (values: any) => async (dispatch: any) => { try { const check = await apiClient.checkConfig(values); dispatch(checkConfigSuccess({ - ...values, - ...check, + web: { ...values.web, ...check.web }, + dns: { ...values.dns, ...check.dns }, + static_ip: check.static_ip, })); } catch (error) { dispatch(addErrorToast({ error })); diff --git a/client/src/install/Setup/Settings.tsx b/client/src/install/Setup/Settings.tsx index bfb9da6e..31e201a0 100644 --- a/client/src/install/Setup/Settings.tsx +++ b/client/src/install/Setup/Settings.tsx @@ -231,7 +231,7 @@ export const Settings = ({ handleSubmit, handleFix, validateForm, config, interf [handleStaticIp], ); - const onSubmit = (data: any) => { + const onSubmit = (data: SettingsFormValues) => { validateForm(data); handleSubmit(data); }; diff --git a/client/tests/e2e/globalSetup.ts b/client/tests/e2e/globalSetup.ts index 6f130b6e..3d56b53e 100644 --- a/client/tests/e2e/globalSetup.ts +++ b/client/tests/e2e/globalSetup.ts @@ -1,17 +1,8 @@ -import { chromium, FullConfig } from '@playwright/test'; -import { existsSync, renameSync } from 'fs'; +import { chromium, type FullConfig } from '@playwright/test'; import { ADMIN_USERNAME, ADMIN_PASSWORD, PORT } from '../constants'; -export const CONFIG_FILE = 'AdGuardHome.yaml'; -export const TEMP_CONFIG_FILE = 'AdGuardHome.yaml.temp'; - async function globalSetup(config: FullConfig) { - // Backup existing config file if it exists - if (existsSync(CONFIG_FILE)) { - renameSync(CONFIG_FILE, TEMP_CONFIG_FILE); - } - const browser = await chromium.launch({ slowMo: 100, }); diff --git a/client/tests/e2e/globalTeardown.ts b/client/tests/e2e/globalTeardown.ts index 8b68c9bb..ae2b60e5 100644 --- a/client/tests/e2e/globalTeardown.ts +++ b/client/tests/e2e/globalTeardown.ts @@ -1,16 +1,12 @@ -import { existsSync, renameSync, unlinkSync } from 'fs'; -import { CONFIG_FILE, TEMP_CONFIG_FILE } from './globalSetup'; +import { existsSync, unlinkSync } from 'fs'; + +export const CONFIG_FILE = '/tmp/AdGuard.temp.e2e.yaml'; async function globalTeardown() { // Remove the test config file if (existsSync(CONFIG_FILE)) { unlinkSync(CONFIG_FILE); } - - // Restore the original config file if it exists - if (existsSync(TEMP_CONFIG_FILE)) { - renameSync(TEMP_CONFIG_FILE, CONFIG_FILE); - } } export default globalTeardown;