diff --git a/test/integration/localization.test.js b/test/integration/localization.test.js index cf02aa86b1bc2c9707950fbb7317506302c836c5..4fb1e8d59f085b93a8fe9d457e720dc5ff7f96e4 100644 --- a/test/integration/localization.test.js +++ b/test/integration/localization.test.js @@ -6,7 +6,9 @@ const { clickXpath, getDriver, getLogs, - loadUri + loadUri, + scope, + rightClickText } = new SeleniumHelper(); const uri = path.resolve(__dirname, '../../build/index.html'); @@ -25,6 +27,13 @@ describe('Localization', () => { test('Localization', async () => { await loadUri(uri); await clickXpath('//button[@title="Try It"]'); + + // Add a sprite to make sure it stays when switching languages + await clickText('Costumes'); + await clickXpath('//button[@aria-label="Choose a Sprite"]'); + await clickText('Apple', scope.modal); // Closes modal + + await clickText('Code'); await clickXpath('//*[@aria-label="language selector"]'); await clickText('Deutsch'); await new Promise(resolve => setTimeout(resolve, 1000)); // wait for blocks refresh @@ -37,6 +46,9 @@ describe('Localization', () => { // Change to the costumes tab to confirm other parts of the GUI are translating await clickText('Kostüme'); + // After switching languages, make sure Apple sprite still exists + await rightClickText('Apple', scope.spriteTile); // Make sure it is there + const logs = await getLogs(); await expect(logs).toEqual([]); });