Support original-language movie requests and fix repair dialog layout
Magent CI/CD / verify (push) Successful in 1m54s
Magent CI/CD / deploy-prod (push) Skipped
Magent CI/CD / deploy-beta (push) Skipped

This commit is contained in:
2026-09-11 18:05:18 +12:00
parent 52c85daae3
commit 38169b881e
11 changed files with 238 additions and 5 deletions
+6
View File
@@ -34,6 +34,12 @@ const base = process.env.REVIEW_BASE || 'http://localhost:3114';
assert.equal(await dialog.getByLabel('Magent account to keep').inputValue(), '36');
assert(await dialog.getByRole('button', { name: 'Confirm duplicate repair' }).isDisabled());
assert(await dialog.evaluate(el => el.scrollWidth <= el.clientWidth), 'No horizontal overflow');
const bounds = await dialog.boundingBox();
assert(Math.abs(bounds.x + bounds.width / 2 - width / 2) < 2, 'Dialog centered horizontally');
assert(bounds.y >= 19 && bounds.y + bounds.height <= 981, 'Dialog stays inside viewport');
await dialog.getByRole('checkbox').scrollIntoViewIfNeeded();
await dialog.getByRole('checkbox').check();
assert(await dialog.getByRole('button', { name: 'Confirm duplicate repair' }).isEnabled());
await page.keyboard.press('Escape'); await dialog.waitFor({ state: 'hidden' });
assert(await trigger.evaluate(el => el === document.activeElement));
}
+48
View File
@@ -0,0 +1,48 @@
const assert = require('node:assert/strict');
const { chromium } = require(process.env.PLAYWRIGHT_PACKAGE || 'playwright');
const base = process.env.REVIEW_BASE || 'http://localhost:3114';
(async () => {
const browser = await chromium.launch();
try {
const context = await browser.newContext();
await context.addCookies([{ name: 'magent_logged_in', value: '1', url: base }]);
const writes = [], errors = [];
await context.route('**/api/**', async route => {
const path = new URL(route.request().url()).pathname;
const media = { title: "Pan's Labyrinth", type: 'movie', tmdbId: 1417, year: 2006, seasons: [], originalLanguage: { code: 'es' } };
if (path === '/api/auth/me') return route.fulfill({ json: { username: 'Admin', role: 'admin' } });
if (path.startsWith('/api/operations/')) return route.fulfill({ json: { status: 'complete', events: [] } });
if (path === '/api/requests/search') return route.fulfill({ json: { results: [media] } });
if (path === '/api/requests/request-options') return route.fulfill({ json: { media, destination: { collector: 'Radarr', serverName: 'Movies', defaultProfileId: 6, profiles: [] } } });
if (path === '/api/requests/create') { writes.push(route.request().postDataJSON()); return route.fulfill({ json: { requestId: 12 } }); }
return route.fulfill({ json: {} });
});
const page = await context.newPage();
page.on('pageerror', e => errors.push(e.message));
for (const width of [1440, 390]) {
await page.setViewportSize({ width, height: 900 });
await page.goto(base + '/new-requests');
await page.getByRole('button', { name: /Film.*Movie/ }).click();
await page.getByLabel('Title', { exact: true }).fill('Pans Labyrinth');
await page.getByRole('button', { name: 'Search Seerr' }).click();
await page.getByRole('button', { name: /Pan's Labyrinth/ }).click();
await page.getByRole('heading', { name: 'Check the audio language' }).waitFor();
assert(await page.locator('.request-language-notice').getByText('Spanish', { exact: true }).isVisible());
const consent = page.getByRole('checkbox');
assert(!await consent.isChecked());
await consent.check();
await page.getByRole('button', { name: 'Change title', exact: true }).click();
await page.getByRole('button', { name: /Pan's Labyrinth/ }).click();
await page.getByRole('heading', { name: 'Check the audio language' }).waitFor();
assert(!await consent.isChecked(), 'Consent resets when changing titles');
await consent.check();
assert(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth));
await page.getByRole('button', { name: 'Request movie', exact: true }).click();
await page.getByText('Request #12 has been accepted by Seerr.', { exact: true }).waitFor();
}
assert.equal(writes.length, 2);
assert(writes.every(w => w.acceptOriginalLanguage === true && w.tmdbId === 1417 && !w.profileId));
assert.deepEqual(errors, []);
console.log('Passed: desktop/mobile warning, Spanish metadata, explicit consent, reset on title change and request payload. All APIs intercepted.');
} finally { await browser.close(); }
})().catch(e => { console.error(e); process.exitCode = 1; });