|
|
@@ -1,5 +1,7 @@
|
|
|
import { expect, test } from '@playwright/test';
|
|
|
|
|
|
+import { appendTextToEditorUntilContains } from '../utils/AppendTextToEditorUntilContains';
|
|
|
+
|
|
|
test('Presentation', async ({ page }) => {
|
|
|
await page.goto('/');
|
|
|
|
|
|
@@ -15,3 +17,26 @@ test('Presentation', async ({ page }) => {
|
|
|
page.getByRole('application').getByRole('heading', { level: 1 }),
|
|
|
).toHaveText(/Welcome to GROWI/);
|
|
|
});
|
|
|
+
|
|
|
+test('Slide page (slide: true frontmatter) renders without crashing', async ({
|
|
|
+ page,
|
|
|
+}) => {
|
|
|
+ await page.goto('/Sandbox/slide-test');
|
|
|
+
|
|
|
+ // create slide content
|
|
|
+ await page.getByTestId('editor-button').click();
|
|
|
+ await expect(page.getByTestId('grw-editor-navbar-bottom')).toBeVisible();
|
|
|
+ await appendTextToEditorUntilContains(
|
|
|
+ page,
|
|
|
+ '---\nslide: true\n---\n# Slide 1\n---\n# Slide 2',
|
|
|
+ );
|
|
|
+ await page.keyboard.press('Control+s');
|
|
|
+
|
|
|
+ // verify slide view renders
|
|
|
+ await page.getByTestId('view-button').click();
|
|
|
+ await expect(page.locator('.slides')).toBeVisible();
|
|
|
+
|
|
|
+ // reload to verify SWR loading path does not crash
|
|
|
+ await page.reload();
|
|
|
+ await expect(page.locator('.slides')).toBeVisible();
|
|
|
+});
|