test(i18n): inspect localized mouse and touch calendars

This commit is contained in:
cesnimda
2026-11-11 12:54:22 +01:00
parent 3e55b3c5aa
commit 285d3c88c7
@@ -56,9 +56,11 @@ try {
await expect(group.getByRole('spinbutton', { name: lang === 'nb' ? 'Dag' : 'Day', exact: true })).toHaveText(String(day));
await expect(group.getByRole('spinbutton', { name: lang === 'nb' ? 'År' : 'Year', exact: true })).toHaveText('2026');
};
const choose24 = async group => {
const choose24 = async (group, reviewCalendar = false) => {
await group.getByRole('button').click();
const calendar = page.getByRole('dialog').filter({ has: page.getByRole('grid') });
await expect(calendar.getByRole('button', { name: language === 'nb' ? 'Neste måned' : 'Next month', exact: true })).toBeVisible();
if (reviewCalendar) await capture('calendar');
await calendar.getByRole('gridcell', { name: '24', exact: true }).click();
if (mobile) await calendar.getByRole('button', { name: 'OK', exact: true }).click();
await expect(page.getByRole('grid')).toHaveCount(0);
@@ -89,7 +91,7 @@ try {
await page.evaluate(value => { localStorage.setItem('uiLanguage', value); window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: value })); }, language);
await expect(edit.getByRole('textbox', { name: copy.editJobJobTitle, exact: true })).toHaveValue('Retain teacher draft');
assert.equal(detailReads, reads); assert.equal(writes.length, 0);
for (const label of [copy.editJobAppliedOn, copy.editJobStatusChangedOn, copy.editJobReplyReceivedOn, copy.editJobFollowUpOn, copy.editJobDeadline]) await choose24(edit.getByRole('group', { name: label, exact: true }));
for (const label of [copy.editJobAppliedOn, copy.editJobStatusChangedOn, copy.editJobReplyReceivedOn, copy.editJobFollowUpOn, copy.editJobDeadline]) await choose24(edit.getByRole('group', { name: label, exact: true }), label === copy.editJobDeadline);
await capture('edit');
await edit.getByRole('button', { name: copy.save, exact: true }).click();
await expect(edit).toBeHidden();