Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

test(settings): wait for the language list to close before tabbing

Josh Corbett9a22b4b9a73d
diff --git a/invokeai/frontend/webv2/src/platform/ui/settings/SettingsSelect.browser.test.tsx b/invokeai/frontend/webv2/src/platform/ui/settings/SettingsSelect.browser.test.tsx
index 91de0439ac..6fce3b499e 100644
--- a/invokeai/frontend/webv2/src/platform/ui/settings/SettingsSelect.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/platform/ui/settings/SettingsSelect.browser.test.tsx
@@ -103,8 +103,11 @@ describe('settings language select', () => {
await expect.element(page.getByRole('dialog', { name: 'Settings', exact: true })).toBeVisible();
await expect.poll(() => dialogContent()?.querySelector('output')?.textContent).toBe('zh-Hant');
await expect.element(language()).toHaveFocus();
+ // Tab only once the list has finished closing: a Tab during its exit
+ // animation races the select's own focus restore.
+ await expect.poll(() => listbox()?.checkVisibility() ?? false).toBe(false);
await act(() => userEvent.keyboard('{Tab}'));
- expect(dialogContent()?.contains(document.activeElement)).toBe(true);
+ await expect.poll(() => dialogContent()?.contains(document.activeElement) ?? false).toBe(true);
});
it('dismisses only the language list with Escape and retains dialog focus', async () => {