From fab554421796c17c0ab2269f5052308f932ddbd8 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Thu, 19 Dec 2024 15:52:10 +0000 Subject: [PATCH] Removed i18n toggle from labs UI (#21927) ref bb9a69e ref https://linear.app/ghost/issue/ENG-1753/labs-flags-cleanup - We promoted i18n to GA several weeks ago now, and it's going fine - Removing the UI first to reduce confusion before cleaning up all the other references to the flag - Also changed the i18n test to set the language back at the end of the test, to ensure no conflicts --- .../settings/advanced/labs/BetaFeatures.tsx | 4 --- .../core/test/e2e-browser/admin/i18n.spec.js | 25 ++++++++++--------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/apps/admin-x-settings/src/components/settings/advanced/labs/BetaFeatures.tsx b/apps/admin-x-settings/src/components/settings/advanced/labs/BetaFeatures.tsx index 97daa8bb2c..37ecb00ff4 100644 --- a/apps/admin-x-settings/src/components/settings/advanced/labs/BetaFeatures.tsx +++ b/apps/admin-x-settings/src/components/settings/advanced/labs/BetaFeatures.tsx @@ -23,10 +23,6 @@ const BetaFeatures: React.FC = () => { action={} detail={<>Enable support for CashApp, iDEAL, Bancontact, and others. Learn more →} title='Additional payment methods' /> - } - detail={<>Translate your membership flows into your publication language (supported languages). Don’t see yours? Get involved} - title='Portal translation' /> { test.describe('Newsletter', () => { test('changing the site language immediately translates strings in newsletters', async ({sharedPage}) => { - await sharedPage.goto('/ghost/#/settings/publication-language'); - const section = sharedPage.getByTestId('publication-language'); - await section.getByRole('button', {name: 'Edit'}).click(); - const input = section.getByPlaceholder('Site language'); - await input.fill('fr'); - await section.getByRole('button', {name: 'Save'}).click(); - - const labsSection = sharedPage.getByTestId('labs'); - await labsSection.getByRole('button', {name: 'Open'}).click(); - let portalLabel = labsSection.getByText('Portal translation'); - let portalToggle = portalLabel.locator('..').locator('..').locator('..').getByRole('switch'); - await portalToggle.click(); + await setLanguage(sharedPage, 'fr'); const postData = { title: 'Publish and email post', @@ -41,6 +39,9 @@ test.describe('i18n', () => { const metaText = await sharedPage.frameLocator('iframe.gh-pe-iframe').locator('td.post-meta').first().textContent(); expect(metaText).toContain('Par Joe Bloggs'); expect(metaText).not.toContain('By Joe Bloggs'); + + // Set the language back before the next test! + await setLanguage(sharedPage, 'en'); }); }); });