From 4f446c44f627f2081bd373727a8defef8f2113fa Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 1 Aug 2024 12:06:16 +0200 Subject: [PATCH] chore: test with the extension tester Signed-off-by: blam --- .../src/wiring/createExtension.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/frontend-plugin-api/src/wiring/createExtension.test.ts b/packages/frontend-plugin-api/src/wiring/createExtension.test.ts index 432fb7f89e..6aa172cc5a 100644 --- a/packages/frontend-plugin-api/src/wiring/createExtension.test.ts +++ b/packages/frontend-plugin-api/src/wiring/createExtension.test.ts @@ -695,7 +695,7 @@ describe('createExtension', () => { const overriden = testExtension.override({ config: { schema: { - bar: z => z.string().optional(), + bar: z => z.string().default('hello'), }, }, factory(originalFactory, { config }) { @@ -707,7 +707,15 @@ describe('createExtension', () => { }, }); - const tester = createExtensionTester(overriden).render(); + expect(createExtensionTester(overriden).data(stringDataRef)).toBe( + 'foo-boom-override-hello', + ); + + expect( + createExtensionTester(overriden, { + config: { foo: 'hello', bar: 'world' }, + }).data(stringDataRef), + ).toBe('foo-hello-override-world'); }); }); });