Skip to content

Commit

Permalink
chore: ensure iframeResizer script is present before saving the form
Browse files Browse the repository at this point in the history
Somehow it was missing on the "error" page 🤷
  • Loading branch information
Leksat committed May 1, 2024
1 parent 9afa08f commit 731027a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/e2e/webform-snapshots/webforms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@ import { execSync } from 'child_process';
import { cmsUrl } from '../helpers/url';

const baseDir = '../../packages/ui/static/stories/webforms';
const iframeResizerSelector =
'script[src*="silverback_iframe/js/iframeResizer.contentWindow.min.js"]';

test('Export webforms for styling', async ({ page }) => {
execSync(`rm -rf ${baseDir}`);

const baseUrl = cmsUrl('/en/form/styling?iframe=true&no_css=true');

await page.goto(baseUrl);
await expect(page.locator(iframeResizerSelector)).toHaveCount(1);
await savePage(page, 'idle');

await page.getByLabel('Email with a confirmation').fill('asd@asd');
await page.getByRole('button', { name: 'Submit' }).click();
await expect(
page.locator('[data-drupal-messages] [role="alert"]'),
).toBeVisible();
await expect(page.locator(iframeResizerSelector)).toHaveCount(1);
await savePage(page, 'error');
});

Expand Down

0 comments on commit 731027a

Please sign in to comment.