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(webv2): align browser coverage with parity contracts

joshistoasta791a0269f43
diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryActions.browser.test.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryActions.browser.test.tsx
index 90d350f354..77e021ac17 100644
--- a/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryActions.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/gallery/ui/useGalleryActions.browser.test.tsx
@@ -619,7 +619,7 @@ describe('mixed gallery upload', () => {
expect(mocks.notificationsAdd).toHaveBeenCalledOnce();
});
- it('reports unsupported and rejected files once without aborting supported uploads', async () => {
+ it('reports the first actionable rejection when every accepted upload fails alongside unsupported files', async () => {
mocks.uploadGalleryVideo.mockRejectedValue(new Error('corrupt video'));
await act(async () => {
@@ -633,7 +633,7 @@ describe('mixed gallery upload', () => {
expect(mocks.notificationsReportError).toHaveBeenCalledOnce();
expect(mocks.notificationsReportError).toHaveBeenCalledWith({
area: 'gallery-upload',
- message: 'No files uploaded. 2 failed.',
+ message: 'corrupt video',
namespace: 'gallery',
});
});
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx
index 06ee208ee2..286ea90820 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx
@@ -60,9 +60,14 @@ vi.mock('@features/queue/react', () => ({
useProgressImage: () => null,
}));
-vi.mock('@features/queue/devices', () => ({
- useDeviceLabel: () => mocks.deviceLabel,
-}));
+vi.mock('@features/queue/devices', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('@features/queue/devices')>();
+
+ return {
+ ...actual,
+ useDeviceLabel: () => mocks.deviceLabel,
+ };
+});
vi.mock('@platform/ui/streaming-image/useStreamingImageSource', () => ({
useStreamingImageSource: () => ({