From 1dbf2ce24bc517368564d7d6eed44f0736c01407 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Mon, 12 Dec 2022 11:06:06 +0000 Subject: [PATCH] add test Signed-off-by: Brian Fletcher --- .../ActionsPage/ActionsPage.test.tsx | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx index 8e2184edf1..02f3c066ca 100644 --- a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx +++ b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx @@ -115,6 +115,48 @@ describe('TemplatePage', () => { expect(rendered.getByText('Test output')).toBeInTheDocument(); }); + it('renders action with multipel input types', async () => { + scaffolderApiMock.listActions.mockResolvedValue([ + { + id: 'test', + description: 'example description', + schema: { + input: { + type: 'object', + required: ['foobar'], + properties: { + foobar: { + title: 'Test title', + type: ['array', 'number'], + }, + }, + }, + output: { + type: 'object', + properties: { + buzz: { + title: 'Test output', + type: 'string', + }, + }, + }, + }, + }, + ]); + const rendered = await renderInTestApp( + + + , + { + mountedRoutes: { + '/create/actions': rootRouteRef, + }, + }, + ); + expect(rendered.getByText('array')).toBeInTheDocument(); + expect(rendered.getByText('number')).toBeInTheDocument(); + }); + it('renders action with oneOf input', async () => { scaffolderApiMock.listActions.mockResolvedValue([ {