Skip to content

Commit

Permalink
chore: add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed Jun 19, 2024
1 parent b49485f commit 3d12129
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ const CodeMirrorBox = ({ label, children }: { label: ReactNode; children: ReactE
{label}
</Box>
)}
{children}
<Box display='flex' flexDirection='column' height='100%' role='code' aria-label={typeof label === 'string' ? label : undefined}>
{children}
</Box>
<Box mbs={8}>
<ButtonGroup>
<Button primary onClick={(): void => toggleFullScreen()}>
Expand Down
13 changes: 13 additions & 0 deletions apps/meteor/tests/e2e/administration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,5 +335,18 @@ test.describe.parallel('administration', () => {
await poAdmin.btnResetSiteURL.click();
});
});

test.describe('Layout', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/admin/settings/Layout');
});

test('should code mirror full screen be displayed correctly', async ({ page }) => {
await poAdmin.getAccordionBtnByName('Custom CSS').click();
await poAdmin.btnFullScreen.click();

await expect(page.getByRole('code')).toHaveCSS('width', '920px');
});
});
});
});
8 changes: 8 additions & 0 deletions apps/meteor/tests/e2e/page-objects/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,12 @@ export class Admin {
get inputWebhookUrl(): Locator {
return this.page.getByRole('textbox', { name: 'Webhook URL' });
}

getAccordionBtnByName(name: string): Locator {
return this.page.getByRole('button', { name });
}

get btnFullScreen(): Locator {
return this.page.getByRole('button', { name: 'Full Screen' });
}
}

0 comments on commit 3d12129

Please sign in to comment.