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(workflows): cover camera tooltip display

JPPhotodc953397babd
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/editor/EditorToolbar.browser.test.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/editor/EditorToolbar.browser.test.tsx
index b219d9d8a8..2038f8c276 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/editor/EditorToolbar.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/editor/EditorToolbar.browser.test.tsx
@@ -4,6 +4,7 @@ import { system } from '@theme/system';
import { act } from 'react';
import { createRoot, type Root } from 'react-dom/client';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import { userEvent } from 'vitest/browser';
const toolbarMocks = vi.hoisted(() => ({
exportWorkflowAsPng: vi.fn(),
@@ -171,6 +172,24 @@ describe('editor toolbar', () => {
expect(camera.disabled).toBe(false);
});
+ it('shows the translated label as a camera tooltip', async () => {
+ await render(1);
+
+ const camera = host!.querySelector<HTMLButtonElement>('button[aria-label="workflow.exportAsPng"]')!;
+ await act(async () => {
+ await userEvent.hover(camera);
+ await new Promise<void>((resolve) => {
+ globalThis.setTimeout(resolve, 500);
+ });
+ });
+
+ const tooltip = [...document.querySelectorAll('[role="tooltip"]')].find(
+ (element) => element.textContent === 'workflow.exportAsPng'
+ );
+
+ expect(tooltip).not.toBeUndefined();
+ });
+
it('reports an export failure and releases the camera action', async () => {
toolbarMocks.exportWorkflowAsPng.mockRejectedValueOnce(new Error('rasterization failed'));
await render(1);