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.

1.0 KB
Raw Blame
import { describe, expect, it } from 'vitest';

import { getPsdExportNotice } from './psdExportNotice';

describe('getPsdExportNotice', () => {
  it.each([
    ['not-ready', 'widgets.layers.groupActions.exportNotReady'],
    ['too-large', 'widgets.layers.groupActions.exportTooLarge'],
    ['nothing', 'widgets.layers.groupActions.exportNothing'],
    ['over-budget', 'widgets.layers.groupActions.exportOverBudget'],
    ['stale', 'widgets.layers.groupActions.exportStale'],
    ['aborted', 'widgets.layers.groupActions.exportAborted'],
  ] as const)('maps %s to a user-visible typed notice', (result, key) => {
    expect(getPsdExportNotice(result)).toEqual({ key });
  });

  it('names the layer that could not be read', () => {
    expect(getPsdExportNotice({ layerId: 'layer-7', layerName: 'Sky', status: 'unreadable' })).toEqual({
      key: 'widgets.layers.groupActions.exportUnreadable',
      options: { name: 'Sky' },
    });
  });

  it('has nothing to say once exported', () => {
    expect(getPsdExportNotice('exported')).toBeNull();
  });
});