From d54c17456d0357709218d9932321756e2902c93b Mon Sep 17 00:00:00 2001 From: Andy O'Neill Date: Mon, 5 Dec 2022 13:04:26 -0500 Subject: [PATCH] test: add integration test that tests monitor labels after switching languages --- test/fixtures/monitor-variable.sb3 | Bin 0 -> 1004 bytes test/integration/localization.test.js | 36 ++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/monitor-variable.sb3 diff --git a/test/fixtures/monitor-variable.sb3 b/test/fixtures/monitor-variable.sb3 new file mode 100644 index 0000000000000000000000000000000000000000..c1f0bc592cecf6c191a5f27df145b6186e171134 GIT binary patch literal 1004 zcmWIWW@h1HU|`^2$nI+mUF0vm(wm8ap^$}vfd?pBP?VpQnp~onRh*xk7nu~ur{i?A@p+DJW&U?du9T{XSKGRv=f^wx_Q!BQH3(^eRbCH`%c%LXb%@Z zy?yV)UoYP1RmSEnN*B1MT))e(_RdikPw{oP7Flj@<2+aQ`_zZj^y1*q1@rwYl69++ zAJ+&=En>WI>-W0dX3u-{TTM&5)^a_&*}75mbH#%&*0veN5A<1o#eBJJbC%^S`%5Ps zvCnn;{f!qKC>A)}qqsxJa?M}v4JY^QFr8PK`9kHYpQv-EZPDyG?lHOn*){q-nwIa*eO+91X5{BaJnPsMj6F=}uK0Tj!r=OqMU{=eV zt@}+cOEpZt?j!EI+yAbHXx_S>Y4>jA-Ak|w@3+FVjW=}cZu=1zf z7k-0nhganVuG@C$@bWU*hsP8oueP|b*m*uYJuQrLlSXa!x`}Q+W^ct~p1E+|*VdOOdnA`}Hr{yesU3Ixrlq8%B^enR8JMIRq$ZoDrdXIH>J^uz=lXi{H7khRsqVVI zo&Cr { const logs = await getLogs(); await expect(logs).toEqual([]); }); + + // Regression test for ENA-142, monitor can lag behind language selection + test('Monitor labels update on locale change', async () => { + await loadUri(uri); + await clickText('File'); + await clickText('Load from your computer'); + const input = await findByXpath('//input[@accept=".sb,.sb2,.sb3"]'); + await input.sendKeys(path.resolve(__dirname, '../fixtures/monitor-variable.sb3')); + + // Monitors are present + await findByText('username', scope.monitors); + await findByText('language', scope.monitors); + + // Change locale to ja + await clickXpath('//*[@aria-label="language selector"]'); + await clickText('日本語'); + + // Monitor labels updated + await findByText('ユーザー名', scope.monitors); + await findByText('言語', scope.monitors); + + // Change locale to ja-hira + await clickText('にほんご'); + + // Monitor labels updated + await findByText('ユーザーめい', scope.monitors); + await findByText('げんご', scope.monitors); + + const logs = await getLogs(); + await expect(logs).toEqual([]); + }); });