mirror of
https://github.com/scratchfoundation/scratch-gui.git
synced 2024-11-25 16:26:20 +08:00
test: add integration test that tests monitor labels after switching languages
This commit is contained in:
parent
97dc338b5a
commit
d54c17456d
BIN
test/fixtures/monitor-variable.sb3
vendored
Normal file
BIN
test/fixtures/monitor-variable.sb3
vendored
Normal file
Binary file not shown.
@ -4,12 +4,13 @@ import SeleniumHelper from '../helpers/selenium-helper';
|
||||
const {
|
||||
clickText,
|
||||
clickXpath,
|
||||
findByText,
|
||||
findByXpath,
|
||||
getDriver,
|
||||
getLogs,
|
||||
loadUri,
|
||||
scope,
|
||||
rightClickText,
|
||||
findByText
|
||||
scope
|
||||
} = new SeleniumHelper();
|
||||
|
||||
const uri = path.resolve(__dirname, '../../build/index.html');
|
||||
@ -74,4 +75,35 @@ describe('Localization', () => {
|
||||
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([]);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user