diff --git a/tests/e2e/specs/drupal/content-editing.spec.ts b/tests/e2e/specs/drupal/content-editing.spec.ts index b90810480..525771f4d 100644 --- a/tests/e2e/specs/drupal/content-editing.spec.ts +++ b/tests/e2e/specs/drupal/content-editing.spec.ts @@ -23,4 +23,33 @@ test.describe('content-editing', () => { // access await expect(page.locator(':text-is("More settings")')).toHaveCount(0); }); + + test('preview a draft translation', async ({ page }) => { + await page.goto(cmsUrl('/en/entity/create/node/page')); + await page + .getByLabel('Title', { exact: true }) + .fill('Will have a draft translation'); + await page.getByLabel('Save as').selectOption('published'); + await page.getByRole('button', { name: 'Save' }).click(); + await page.getByLabel('Headline').fill('Will have a draft translation'); + await page.getByText('Save', { exact: true }).click(); + await page.getByRole('link', { name: 'Translate' }).click(); + const translateUrl = page.url(); + await page.getByRole('link', { name: 'Add', exact: true }).click(); + await page.getByLabel('Titel', { exact: true }).fill('A draft translation'); + await page.getByLabel('Ändern in').selectOption('draft'); + await page.getByLabel('Headline').fill('A draft translation'); + await page.getByText('Speichern (diese Übersetzung)').click(); + + await page.goto(translateUrl); + await page + .getByRole('link', { name: 'A draft translation', exact: true }) + .click(); + await expect( + page + .frameLocator('iframe') + .first() + .getByRole('heading', { name: 'A draft translation' }), + ).toBeVisible(); + }); });