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

Function setupComponent

apps/wallet/src/test.utils.ts:68–86  ·  view source on GitHub ↗
(
  setupFunction: () => RawBindings,
)

Source from the content-addressed store, hash-verified

66};
67
68export const setupComponent = <Props, RawBindings>(
69 setupFunction: () => RawBindings,
70): ComponentPublicInstance<Props, RawBindings> => {
71 const app = createApp({
72 setup: setupFunction,
73 template: '<div></div>',
74 });
75
76 app.use(createTestingPinia());
77 app.use(mockRouter);
78 app.use(vuetify());
79 app.use(i18n);
80 app.use(serviceManager);
81 app.use(navigation.withSections({ main: [] }));
82
83 const container = document.createElement('div');
84
85 return app.mount(container) as ComponentPublicInstance<Props, RawBindings>;
86};
87
88export function createMockRef<T>(value: T): Ref<T> {
89 return { value } as Ref<T>;

Calls 2

vuetifyFunction · 0.90
withSectionsMethod · 0.80

Tested by

no test coverage detected