[ui] DomiUi: @domi/ui v1.2.0; on Android the town field is an editable box, so focusing it sends no Autofill request (TextField as=auto)

This commit is contained in:
2026-11-23 01:34:49 +01:00
parent 8018268821
commit 7f8b6861f9
17 changed files with 312 additions and 28 deletions
+14
View File
@@ -45,6 +45,20 @@ describe('the garden asks where the sunset is', () => {
expect(document.activeElement).toBe(document.body);
});
it('on Android the town field is no native text field, so the WebView asks no Autofill service (domi-ui.md D10)', async () => {
vi.spyOn(navigator, 'userAgent', 'get').mockReturnValue('Mozilla/5.0 (Linux; Android 16; WAVE 10C) AppleWebKit/537.36 Chrome/140.0 Mobile Safari/537.36');
render(Shell, { sunset: wiring() });
const field = await screen.findByRole('textbox', { name: en.sunset.searchLabel });
expect(field.getAttribute('contenteditable')).toBe('plaintext-only');
expect(document.querySelector('.ask input:not([type="hidden"]), .ask textarea')).toBeNull();
});
it('elsewhere it stays the native search field', async () => {
render(Shell, { sunset: wiring() });
expect(await screen.findByRole('searchbox', { name: en.sunset.searchLabel })).toBeTruthy();
expect(screen.queryByRole('textbox', { name: en.sunset.searchLabel })).toBeNull();
});
it('typing lists towns, choosing one shows its sunset, keeps it, and moves focus to the answer', async () => {
const w = wiring();
render(Shell, { sunset: w });