mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-08-27 05:52:50 +02:00
21 lines
567 B
TypeScript
21 lines
567 B
TypeScript
import { render } from '@testing-library/vue';
|
|
|
|
import { N8nPlugin } from 'n8n-design-system/plugin';
|
|
|
|
type Component = Parameters<typeof render>[0];
|
|
type RenderOptions = Parameters<typeof render>[1];
|
|
|
|
export const createComponentRenderer = (component: Component) => (options: RenderOptions) => {
|
|
const mergedOptions: RenderOptions = {
|
|
...options,
|
|
global: {
|
|
...(options?.global ?? {}),
|
|
stubs: {
|
|
...(options?.global?.stubs ?? {}),
|
|
},
|
|
plugins: [N8nPlugin, ...(options?.global?.plugins ?? [])],
|
|
},
|
|
};
|
|
return render(component, mergedOptions);
|
|
};
|