forked from laysense/laysense.cn
Expand page templates and configure page visibility
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user