test(cv): retain localized template entitlement coverage

This commit is contained in:
cesnimda
2026-10-20 20:50:34 +02:00
parent c5cfc8756c
commit e698ed6c57
@@ -151,11 +151,11 @@ for (const [mode, language, premium] of [['light', 'en', false], ['dark', 'nb',
await scan(page, info, 'phone-advanced');
await page.setViewportSize({ width: 1440, height: 900 }); await page.getByRole('tab', { name: t.cvEditorTemplate, exact: true }).click();
await page.getByRole('button', { name: t.cvEditorAllTemplates, exact: true }).click();
const technical = page.getByRole('button', { name: 'Technical', exact: true }); await expect(technical).toHaveAttribute('aria-disabled', premium ? 'false' : 'true');
const technical = page.getByRole('button', { name: t.cvTemplateTechnicalName, exact: true }); await expect(technical).toHaveAttribute('aria-disabled', premium ? 'false' : 'true');
await expect(technical).toHaveAccessibleDescription(new RegExp(premium ? t.cvEditorProUnlocked : t.cvEditorPro));
if (!premium) { await technical.click({ force: true }); await technical.focus(); await page.keyboard.press('Enter'); expect((await read()).settings.themeId).toBe('minimal'); await expect(page.getByRole('dialog')).toHaveCount(0); }
await capture(page, info, 'templates'); await scan(page, info, 'templates');
const target = premium ? technical : page.getByRole('button', { name: 'Code', exact: true });
const target = premium ? technical : page.getByRole('button', { name: t.cvTemplateCodeName, exact: true });
await target.focus(); await page.keyboard.press('Enter');
const dialog = page.getByRole('dialog', { name: t.cvEditorChangeTemplateTitle }); await expect(dialog).toBeVisible(); await capture(page, info, 'reset-confirmation');
await page.keyboard.press('Escape'); await expect(target).toBeFocused(); expect((await read()).settings.themeId).toBe('minimal');