From 02f4265b29eb1c147de7e3a630547bbe6c6b66d7 Mon Sep 17 00:00:00 2001
From: chrisgarrity <chrisg@media.mit.edu>
Date: Wed, 18 Jul 2018 10:29:38 -0400
Subject: [PATCH] Re-enable localization test

HT @paulkaplan
---
 src/components/menu-bar/menu-bar.jsx  |  2 +-
 test/integration/localization.test.js | 25 ++++++++++---------------
 2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/src/components/menu-bar/menu-bar.jsx b/src/components/menu-bar/menu-bar.jsx
index 95a9803a3..08bd6b556 100644
--- a/src/components/menu-bar/menu-bar.jsx
+++ b/src/components/menu-bar/menu-bar.jsx
@@ -159,7 +159,7 @@ class MenuBar extends React.Component {
                             })}
                             onMouseUp={this.handleLanguageMouseUp}
                         >
-                            {/* @TODO: remove coming soon tooltip wrapper */}
+                            {/* @TODO: remove coming soon tooltip wrapper  https://github.com/LLK/scratch-gui/issues/2664  */}
                             <MenuBarItemTooltip
                                 enable
                                 id="menubar-selector"
diff --git a/test/integration/localization.test.js b/test/integration/localization.test.js
index deaf1a788..101d3ce86 100644
--- a/test/integration/localization.test.js
+++ b/test/integration/localization.test.js
@@ -4,11 +4,9 @@ import SeleniumHelper from '../helpers/selenium-helper';
 const {
     clickText,
     clickXpath,
-    findByText,
     getDriver,
     getLogs,
-    loadUri,
-    scope
+    loadUri
 } = new SeleniumHelper();
 
 const uri = path.resolve(__dirname, '../../build/index.html');
@@ -24,24 +22,21 @@ describe('Localization', () => {
         await driver.quit();
     });
 
-    // Skipped temporarily while the language selector is marked as
-    // "Coming Soon"
-    test.skip('Localization', async () => {
+    test('Localization', async () => {
         await loadUri(uri);
         await clickXpath('//button[@title="tryit"]');
-        await clickText('Code');
-        await clickXpath('//button[@title="Add Extension"]');
-        await clickText('Pen', scope.modal); // Modal closes
-        await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation
+        await clickXpath('//*[@aria-label="language selector"]');
         await clickText('English');
         await clickText('Deutsch');
         await new Promise(resolve => setTimeout(resolve, 1000)); // wait for blocks refresh
-        await clickText('Pen'); // will need to be updated when 'Pen' is translated
 
-        // Make sure "Add Sprite" has changed to "Figur hinzufügen"
-        await findByText('Figur hinzufügen');
-        // Find the stamp block in German
-        await findByText('Abdruck');
+        // Make sure the blocks are translating
+        await clickText('Fühlen'); // Sensing category in German
+        await new Promise(resolve => setTimeout(resolve, 1000)); // wait for blocks to scroll
+        await clickText('Antwort'); // Find the "answer" block in German
+
+        // Change to the costumes tab to confirm other parts of the GUI are translating
+        await clickText('Kostüme');
 
         const logs = await getLogs();
         await expect(logs).toEqual([]);
-- 
GitLab