Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

1.0 KB
Raw Blame
import { describe, expect, test } from "vitest";

import { getImmichStatsLayout, getImmichStatVisibility } from "./component";

describe("Immich server statistics compact layout", () => {
  test("keeps the v1 one-column non-dense layout at every compact size", () => {
    expect(getImmichStatsLayout(280, 120, 4)).toEqual({ columns: 1, dense: false });
    expect(getImmichStatsLayout(480, 120, 4)).toEqual({ columns: 1, dense: false });
    expect(getImmichStatsLayout(360, 240, 4)).toEqual({ columns: 1, dense: false });
    expect(getImmichStatsLayout(200, 180, 4)).toEqual({ columns: 1, dense: false });
  });

  test("advanced mode shows all four headline stats", () => {
    const options = { showUsers: false, showPhotos: false, showVideos: false, showStorage: false };

    expect(getImmichStatVisibility(options, true)).toEqual({
      showUsers: true,
      showPhotos: true,
      showVideos: true,
      showStorage: true,
    });
    expect(getImmichStatVisibility(options, false)).toEqual(options);
  });
});