From 4b1b4bab3226d3688b3fc8e66497e049e252e0d7 Mon Sep 17 00:00:00 2001 From: mathuo <6710312+mathuo@users.noreply.github.com> Date: Thu, 25 Apr 2024 21:10:07 +0100 Subject: [PATCH] chore: fix tests --- .../dockview/dockviewComponent.spec.ts | 60 +++++++++++++++---- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/packages/dockview-core/src/__tests__/dockview/dockviewComponent.spec.ts b/packages/dockview-core/src/__tests__/dockview/dockviewComponent.spec.ts index 9da562e6e..569670d09 100644 --- a/packages/dockview-core/src/__tests__/dockview/dockviewComponent.spec.ts +++ b/packages/dockview-core/src/__tests__/dockview/dockviewComponent.spec.ts @@ -5103,8 +5103,16 @@ describe('dockviewComponent', () => { const dockview = new DockviewComponent({ parentElement: container, - components: { - default: PanelContentPartTest, + createComponent(options) { + switch (options.name) { + case 'default': + return new PanelContentPartTest( + options.id, + options.name + ); + default: + throw new Error(`unsupported`); + } }, }); const api = new DockviewApi(dockview); @@ -5130,8 +5138,16 @@ describe('dockviewComponent', () => { const dockview = new DockviewComponent({ parentElement: container, - components: { - default: PanelContentPartTest, + createComponent(options) { + switch (options.name) { + case 'default': + return new PanelContentPartTest( + options.id, + options.name + ); + default: + throw new Error(`unsupported`); + } }, }); const api = new DockviewApi(dockview); @@ -5159,8 +5175,16 @@ describe('dockviewComponent', () => { const dockview = new DockviewComponent({ parentElement: container, - components: { - default: PanelContentPartTest, + createComponent(options) { + switch (options.name) { + case 'default': + return new PanelContentPartTest( + options.id, + options.name + ); + default: + throw new Error(`unsupported`); + } }, }); const api = new DockviewApi(dockview); @@ -5188,8 +5212,16 @@ describe('dockviewComponent', () => { const dockview = new DockviewComponent({ parentElement: container, - components: { - default: PanelContentPartTest, + createComponent(options) { + switch (options.name) { + case 'default': + return new PanelContentPartTest( + options.id, + options.name + ); + default: + throw new Error(`unsupported`); + } }, }); const api = new DockviewApi(dockview); @@ -5216,8 +5248,16 @@ describe('dockviewComponent', () => { const dockview = new DockviewComponent({ parentElement: container, - components: { - default: PanelContentPartTest, + createComponent(options) { + switch (options.name) { + case 'default': + return new PanelContentPartTest( + options.id, + options.name + ); + default: + throw new Error(`unsupported`); + } }, }); const api = new DockviewApi(dockview);