From 984eb1b073ed8b154f169794e91d5aec71917819 Mon Sep 17 00:00:00 2001
From: Paul Kaplan <pkaplan@media.mit.edu>
Date: Mon, 4 Feb 2019 09:33:43 -0500
Subject: [PATCH] Include a regression test for #4476

---
 test/integration/localization.test.js | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/test/integration/localization.test.js b/test/integration/localization.test.js
index 4fb1e8d59..e7cc64e90 100644
--- a/test/integration/localization.test.js
+++ b/test/integration/localization.test.js
@@ -24,7 +24,7 @@ describe('Localization', () => {
         await driver.quit();
     });
 
-    test('Localization', async () => {
+    test('Switching languages', async () => {
         await loadUri(uri);
         await clickXpath('//button[@title="Try It"]');
 
@@ -52,4 +52,15 @@ describe('Localization', () => {
         const logs = await getLogs();
         await expect(logs).toEqual([]);
     });
+
+    // Regression test for #4476, blocks in wrong language when loaded with locale
+    test('Loading with locale shows correct blocks', async () => {
+        await loadUri(`${uri}?locale=de`);
+        await clickXpath('//button[@title="Ausprobieren!"]'); // "Try It"
+        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
+        const logs = await getLogs();
+        await expect(logs).toEqual([]);
+    });
 });
-- 
GitLab