should fix admin e2e test

This commit is contained in:
Henry Jameson 2026-06-23 18:26:01 +03:00
commit ab34412a2e
4 changed files with 17 additions and 15 deletions

View file

@ -39,6 +39,8 @@ services:
interval: 5s
timeout: 3s
retries: 60
ports:
- 4000:4000
e2e:
build:

View file

@ -132,6 +132,7 @@ export const promisedRequest = async ({
)
}
} catch (error) {
if (error.name === 'StatusCodeError') throw error
throw new Error(error, { url, options }, response)
}
}

View file

@ -87,22 +87,19 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
loadAdminStuff() {
getInstanceDBConfig({
credentials: useOAuthStore().token,
}).then(({ data: backendDbConfig }) => {
if (backendDbConfig.error) {
if (backendDbConfig.error.status === 400) {
backendDbConfig.error.json().then((errorJson) => {
if (/configurable_from_database/.test(errorJson.error)) {
this.setInstanceAdminNoDbConfig()
}
})
}
} else {
})
.then(({ data: backendDbConfig }) =>
this.setInstanceAdminSettings({
credentials: useOAuthStore().token,
backendDbConfig,
})
}
})
}))
.catch(({ statusCode, statusText }) => {
if (statusCode === 400) {
if (/configurable_from_database/.test(statusText)) {
this.setInstanceAdminNoDbConfig()
}
}
})
if (this.descriptions === null) {
getInstanceConfigDescriptions({
credentials: useOAuthStore().token,

View file

@ -1,7 +1,7 @@
/* global process */
import { defineConfig, devices } from 'playwright/test'
const baseURL = process.env.E2E_BASE_URL || 'http://localhost:8080'
const baseURL = process.env.E2E_BASE_URL || 'http://localhost:8099'
export default defineConfig({
testDir: './specs',
@ -25,12 +25,14 @@ export default defineConfig({
video: 'retain-on-failure',
},
webServer: {
command: 'yarn dev -- --host 0.0.0.0 --port 8080 --strictPort',
command: 'yarn dev -- --host 0.0.0.0 --strictPort',
url: baseURL,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
env: {
...process.env,
PORT:
process.env.PORT || '8099',
VITE_PROXY_TARGET:
process.env.VITE_PROXY_TARGET || 'http://localhost:4000',
VITE_PROXY_ORIGIN: