Let the title-screen language buttons work before a game exists

The click dispatcher only lets a short list of actions through while there
is no game yet, so picking a language on a fresh title screen did nothing.
The test now clicks the button instead of calling the action.
This commit is contained in:
Danilo Carbonaro 2026-10-24 15:31:03 +02:00
parent 42711456e2
commit 42acec3f07
2 changed files with 7 additions and 1 deletions

View file

@ -79,6 +79,12 @@ test('every Italian entry keeps the placeholders and HTML tags of its English te
assert.deepEqual(brokenEntries(dict), []);
});
test('the language buttons on the title screen work before any game exists', () => {
const { ev } = load();
ev("[...document.querySelectorAll('#modalCard [data-act=langSet]')].find(b=>b.textContent==='Italiano').click()");
assert.equal(ev("localStorage.getItem('sot-lang')"), 'it');
});
test('picking a language saves the choice and the game, then reloads', () => {
const { ev } = load();
ev('ACT.start({});dayTick()');