Expand page templates and configure page visibility

This commit is contained in:
2026-11-22 12:54:01 +08:00
parent 931d333ca7
commit f23c3b95ba
27 changed files with 293 additions and 44 deletions
+3 -2
View File
@@ -303,7 +303,8 @@ async function verifyPageTemplateDrawer(context, page, slug, csrf) {
await opener.click();
const drawer = page.getByRole('dialog', {name: '整页模板'});
const groups = drawer.locator('[data-template-group]:visible');
assert.equal(await groups.count(), 3);
const themes = ['cobalt', 'studio', 'dusk', 'vantage', 'ribbon', 'furrow'];
assert.equal(await groups.count(), themes.length);
const assertThumbnails = async (cards) => {
assert(await cards.locator('img').evaluateAll(async (images) => {
await Promise.all(images.map((image) => image.decode()));
@@ -311,7 +312,7 @@ async function verifyPageTemplateDrawer(context, page, slug, csrf) {
}));
};
await assertThumbnails(groups);
for (const theme of ['cobalt', 'studio', 'dusk']) {
for (const theme of themes) {
await drawer.locator(`[data-template-group="${theme}"]`).click();
const pages = drawer.locator('[data-page-template]:visible');
assert.equal(await pages.count(), 2);