Fix settings page compatibility and add debug access

This commit is contained in:
ajp_anton
2026-08-02 15:28:45 +00:00
parent a0a535c64a
commit ef4cd3dc9c
7 changed files with 128 additions and 12 deletions
+43 -2
View File
@@ -185,10 +185,51 @@ test('saves admin configuration through the dashboard page', async ({ page, requ
expect(config.PrecacheTvShowLibraries).toBeFalsy();
});
test('renders provider controls without native replaceChildren support', async ({ page }) => {
await page.addInitScript(() => {
Object.defineProperty(Element.prototype, 'replaceChildren', { configurable: true, value: undefined });
});
await signIn(page);
await page.goto('/web/#/configurationpage?name=Multilang');
await expect(page.locator('#ml-provider-inputs input[data-provider]')).toHaveCount(2);
});
test('opens a resolved debug view from both settings pages', async ({ page }) => {
await signIn(page);
await page.goto('/web/#/configurationpage?name=Multilang');
await expect(page.locator('#ml-admin')).toBeVisible();
await page.locator('#ml-debug-item-id').fill(fixture.orderedItemIds[0]);
await page.locator('#ml-debug-user-id').fill(fixture.userId);
const [adminDebug] = await Promise.all([
page.waitForEvent('popup'),
page.locator('#ml-debug-open').click()
]);
await expect(adminDebug).toHaveURL(new RegExp(`/Multilang/DebugUi/${fixture.orderedItemIds[0]}.*userId=${fixture.userId}`));
await expect(adminDebug.locator('#ml-debug-status')).toHaveText('Loaded.');
await adminDebug.close();
await page.goto(`/web/#/mypreferencesmenu?userId=${fixture.userId}`);
await expect(page.locator('#mlUserRulesMenuItem')).toBeVisible();
await page.getByRole('button', { name: 'User Menu' }).click();
await expect(page.locator('.MuiMenu-list #mlUserRulesMenuItem')).toHaveCount(0);
await page.keyboard.press('Escape');
await page.locator('#mlUserRulesMenuItem').click();
await expect(page.locator('#ml-user')).toBeVisible();
await page.locator('#ml-debug-item-id').fill(fixture.orderedItemIds[0]);
const [userDebug] = await Promise.all([
page.waitForEvent('popup'),
page.locator('#ml-debug-open').click()
]);
await expect(userDebug).toHaveURL(new RegExp(`/Multilang/DebugUi/${fixture.orderedItemIds[0]}`));
await expect(userDebug).not.toHaveURL(/userId=/);
await expect(userDebug.locator('#ml-debug-status')).toHaveText('Loaded.');
await userDebug.close();
});
test('saves a structured classification rule through the user settings page', async ({ page, request }) => {
await signIn(page);
await page.goto(`/web/#/mypreferences?userId=${fixture.userId}`);
await page.getByRole('button', { name: 'User Menu' }).click();
await page.goto(`/web/#/mypreferencesmenu?userId=${fixture.userId}`);
await expect(page.locator('#mlUserRulesMenuItem')).toBeVisible();
await page.locator('#mlUserRulesMenuItem').click();
await expect(page.locator('#ml-user')).toBeVisible();