Skip to content

Commit

Permalink
test: preview draft-only translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Leksat committed Jan 14, 2025
1 parent 2924411 commit f0ed24d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/e2e/specs/drupal/content-editing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});

0 comments on commit f0ed24d

Please sign in to comment.