Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

821 B
Raw Blame
import { PLUGIN_RESOURCE_DOWNLOADS } from "metabase/plugins";
import { createMockTokenFeatures } from "metabase-types/api/mocks";

import { downloadsEnabledTestData, setup } from "./setup";

describe("[EE - with token features] resource downloads plugin", () => {
  describe("areDownloadsEnabled", () => {
    beforeEach(() => {
      setup({
        tokenFeatures: createMockTokenFeatures({ whitelabel: true }),
        enterprisePlugins: ["resource_downloads"],
      });
    });

    it.each(downloadsEnabledTestData)(
      `with { downloads:$downloads } it should return $downloadsEnabled`,
      ({ downloads, downloadsEnabled }) => {
        expect(
          PLUGIN_RESOURCE_DOWNLOADS.areDownloadsEnabled({
            downloads,
          }),
        ).toStrictEqual(downloadsEnabled);
      },
    );
  });
});