Skip to content
Snippets Groups Projects
Unverified Commit 91054076 authored by Anton Kulyk's avatar Anton Kulyk Committed by GitHub
Browse files

Simplify `createMockSettingsState` utility (#27546)

parent f1d355d4
No related branches found
No related tags found
No related merge requests found
import { SettingsState } from "metabase-types/store";
import type { Settings } from "metabase-types/api";
import type { SettingsState } from "metabase-types/store";
import { createMockSettings } from "metabase-types/api/mocks";
export const createMockSettingsState = (
opts?: Partial<SettingsState>,
opts?: Partial<Settings>,
): SettingsState => ({
values: createMockSettings(),
...opts,
values: createMockSettings(opts),
});
......@@ -3,7 +3,6 @@ import { screen, waitFor } from "@testing-library/react";
import _ from "underscore";
import { renderWithProviders } from "__support__/ui";
import { createMockSettings } from "metabase-types/api/mocks";
import { createMockSettingsState } from "metabase-types/store/mocks";
import EmbedModalContent from "./EmbedModalContent";
......@@ -145,10 +144,8 @@ function renderWithConfiguredProviders(element: JSX.Element) {
renderWithProviders(element, {
storeInitialState: {
settings: createMockSettingsState({
values: createMockSettings({
"enable-embedding": true,
"embedding-secret-key": "my_super_secret_key",
}),
"enable-embedding": true,
"embedding-secret-key": "my_super_secret_key",
}),
},
});
......
......@@ -5,7 +5,7 @@ import type { Settings } from "metabase-types/api";
export function mockSettings(params: Partial<Settings> = {}) {
const settings = createMockSettings(params);
const state = createMockSettingsState({ values: settings });
const state = createMockSettingsState(settings);
MetabaseSettings.setAll(settings);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment