MCPcopy Create free account
hub / github.com/dfinity/orbit / mount

Function mount

apps/wallet/src/test.utils.ts:34–66  ·  view source on GitHub ↗
(
  component: T,
  options: ComponentMountingOptions<T> = {},
  overrides: {
    initialPiniaState?: StateTree;
    plugins?: {
      pinia?: Plugin;
    };
  } = {},
)

Source from the content-addressed store, hash-verified

32};
33
34export const mount = <T extends Component>(
35 component: T,
36 options: ComponentMountingOptions<T> = {},
37 overrides: {
38 initialPiniaState?: StateTree;
39 plugins?: {
40 pinia?: Plugin;
41 };
42 } = {},
43) => {
44 const mocks = options.global?.mocks || {};
45 const plugins = options.global?.plugins || [];
46
47 return componentMount(component, {
48 ...options,
49 global: {
50 ...options.global,
51 plugins: [
52 overrides.plugins?.pinia ??
53 createTestingPinia({ initialState: overrides.initialPiniaState }),
54 vuetify(),
55 i18n,
56 serviceManager,
57 navigation.withSections({ main: [] }),
58 mockRouter,
59 ...plugins,
60 ],
61 mocks: {
62 ...mocks,
63 },
64 },
65 });
66};
67
68export const setupComponent = <Props, RawBindings>(
69 setupFunction: () => RawBindings,

Calls 2

vuetifyFunction · 0.90
withSectionsMethod · 0.80

Tested by

no test coverage detected