👔(app-impress) save the templates editor automatically
On almost each change in the code editor, the template is saved automatically. It will restore as well the editor when we arrive on the template editor page.
This commit is contained in:
@@ -26,4 +26,37 @@ test.describe('Template Editor', () => {
|
||||
page.locator('.gjs-editor .gjs-block[title="Text"]'),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test('checks the template editor save on changed', async ({
|
||||
page,
|
||||
browserName,
|
||||
}) => {
|
||||
const randomTemplate = await createTemplate(
|
||||
page,
|
||||
'template-editor',
|
||||
browserName,
|
||||
1,
|
||||
);
|
||||
|
||||
await expect(page.locator('h2').getByText(randomTemplate[0])).toBeVisible();
|
||||
|
||||
const iframe = page.frameLocator('iFrame.gjs-frame');
|
||||
|
||||
await page.getByTitle('Open Blocks').click();
|
||||
await page
|
||||
.locator('.gjs-editor .gjs-block[title="Text"]')
|
||||
.dragTo(iframe.locator('body.gjs-dashed'));
|
||||
|
||||
await iframe.getByText('Insert your text here').fill('Hello World');
|
||||
await iframe.locator('body.gjs-dashed').click();
|
||||
|
||||
// Come on the page again to check the changes are saved
|
||||
await page.locator('menu').first().getByLabel(`Template button`).click();
|
||||
const panel = page.getByLabel('Templates panel').first();
|
||||
await panel.locator('li').getByText(randomTemplate[0]).click();
|
||||
|
||||
await expect(iframe.getByText('Hello World')).toBeVisible({
|
||||
timeout: 5000,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user