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.

931 B
Raw Blame
import type { WorkbenchNotificationCommands } from '@workbench/workbenchStore';

import { describe, expect, it, vi } from 'vitest';

import { recordCanvasImportError } from './canvasImportError';

describe('recordCanvasImportError', () => {
  it('dispatches one localized diagnostic error and no notice', () => {
    const reportError = vi.fn();
    const notifications = { reportError } as unknown as WorkbenchNotificationCommands;

    recordCanvasImportError({
      notifications,
      error: new Error('resize backend failed'),
      localizedMessage: "Couldn't add images to canvas",
      projectId: 'project-1',
    });

    expect(reportError).toHaveBeenCalledTimes(1);
    expect(reportError).toHaveBeenCalledWith({
      area: 'image-actions',
      context: { error: 'resize backend failed' },
      message: "Couldn't add images to canvas",
      namespace: 'gallery',
      projectId: 'project-1',
    });
  });
});