From 6d2258621f5e3ed4ef98e18d5478ca0e3ad9600d Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 18 Oct 2023 13:36:39 +0200 Subject: [PATCH] frontend-app-api: update resolveAppNodeSpecs tests Signed-off-by: Patrik Oldsberg --- .../src/graph/resolveAppNodeSpecs.test.ts | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/packages/frontend-app-api/src/graph/resolveAppNodeSpecs.test.ts b/packages/frontend-app-api/src/graph/resolveAppNodeSpecs.test.ts index 1d3c0a26ed..a3cda23113 100644 --- a/packages/frontend-app-api/src/graph/resolveAppNodeSpecs.test.ts +++ b/packages/frontend-app-api/src/graph/resolveAppNodeSpecs.test.ts @@ -54,8 +54,18 @@ describe('resolveAppNodeSpecs', () => { parameters: [], }), ).toEqual([ - { extension: a, attachTo: { id: 'root', input: 'default' } }, - { extension: b, attachTo: { id: 'root', input: 'default' } }, + { + id: 'a', + extension: a, + attachTo: { id: 'root', input: 'default' }, + disabled: false, + }, + { + id: 'b', + extension: b, + attachTo: { id: 'root', input: 'default' }, + disabled: false, + }, ]); }); @@ -76,11 +86,18 @@ describe('resolveAppNodeSpecs', () => { }), ).toEqual([ { + id: 'a', extension: a, attachTo: { id: 'root', input: 'default' }, source: pluginA, + disabled: false, + }, + { + id: 'b', + extension: b, + attachTo: { id: 'derp', input: 'default' }, + disabled: false, }, - { extension: b, attachTo: { id: 'derp', input: 'default' } }, ]); }); @@ -109,16 +126,20 @@ describe('resolveAppNodeSpecs', () => { }), ).toEqual([ { + id: 'a', extension: a, attachTo: { id: 'root', input: 'default' }, source: plugin, config: { foo: { bar: 1 } }, + disabled: false, }, { + id: 'b', extension: b, attachTo: { id: 'root', input: 'default' }, source: plugin, config: { foo: { qux: 3 } }, + disabled: false, }, ]); }); @@ -142,8 +163,18 @@ describe('resolveAppNodeSpecs', () => { ], }), ).toEqual([ - { extension: b, attachTo: { id: 'root', input: 'default' } }, - { extension: a, attachTo: { id: 'root', input: 'default' } }, + { + id: 'b', + extension: b, + attachTo: { id: 'root', input: 'default' }, + disabled: false, + }, + { + id: 'a', + extension: a, + attachTo: { id: 'root', input: 'default' }, + disabled: false, + }, ]); }); @@ -173,10 +204,12 @@ describe('resolveAppNodeSpecs', () => { expect(result[0].source).toBe(plugin); expect(result[1]).toEqual({ + id: 'c', extension: cOverride, attachTo: { id: 'root', input: 'default' }, config: undefined, source: undefined, + disabled: false, }); });