From 78f1a32b4bcb0380b9fbc287e650e135627a85dc Mon Sep 17 00:00:00 2001 From: Olga Nad Date: Wed, 7 Sep 2022 10:49:17 -0500 Subject: [PATCH] fix: inputHelpers tests regression Signed-off-by: Olga Nad --- .../LaunchForm/inputHelpers/test/inputHelpers.test.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/zapp/console/src/components/Launch/LaunchForm/inputHelpers/test/inputHelpers.test.ts b/packages/zapp/console/src/components/Launch/LaunchForm/inputHelpers/test/inputHelpers.test.ts index d84d83318..bd4308cc7 100644 --- a/packages/zapp/console/src/components/Launch/LaunchForm/inputHelpers/test/inputHelpers.test.ts +++ b/packages/zapp/console/src/components/Launch/LaunchForm/inputHelpers/test/inputHelpers.test.ts @@ -30,6 +30,7 @@ const baseInputProps: InputProps = { onChange: () => {}, required: false, typeDefinition: inputTypes.unknown, + setIsError: () => {}, }; function makeSimpleInput(typeDefinition: InputTypeDefinition, value: any): InputProps { @@ -98,7 +99,7 @@ describe('literalToInputValue', () => { }); }); - it('should return empty for noneType literals', () => { + it('should return literal as an empty object for noneType literals', () => { const map: Core.ILiteral = { map: { literals: { a: literalNone() }, @@ -110,7 +111,9 @@ describe('literalToInputValue', () => { type: InputType.None, }; - expect(literalToInputValue(mapInputTypeDefinition(typeDefinition), map)).toEqual('{}'); + expect(literalToInputValue(mapInputTypeDefinition(typeDefinition), map)).toEqual(`{ + "a": {} +}`); }); }); @@ -135,7 +138,7 @@ describe('literalToInputValue', () => { }); }); - it('should return empty for noneType literals', () => { + it('should return empty objects for each noneType literals', () => { const collection: Core.ILiteral = { collection: { // Duplicate it to test comma separation @@ -150,7 +153,7 @@ describe('literalToInputValue', () => { expect( literalToInputValue(collectionInputTypeDefinition(typeDefinition), collection), - ).toEqual('[]'); + ).toEqual('[{},{}]'); }); });