From fae5dfb64feda4fb2840fc60b0cbb0b713ff7782 Mon Sep 17 00:00:00 2001 From: bduran Date: Tue, 15 Aug 2023 18:16:44 -0700 Subject: [PATCH] fix merge conflict error --- src/utilities/parameters.test.ts | 106 ++++++++++++++++++++----------- 1 file changed, 68 insertions(+), 38 deletions(-) diff --git a/src/utilities/parameters.test.ts b/src/utilities/parameters.test.ts index 0005ae8e9e..de94f29788 100644 --- a/src/utilities/parameters.test.ts +++ b/src/utilities/parameters.test.ts @@ -92,55 +92,57 @@ describe('getArgument', () => { valueSource: 'none', }); }); +}); - describe('getValueSchemaDefaultValue', () => { - test('boolean', () => { - const defaultBooleanValue = getValueSchemaDefaultValue({ type: 'boolean' }); - expect(defaultBooleanValue).toEqual(false); - }); +describe('getValueSchemaDefaultValue', () => { + test('boolean', () => { + const defaultBooleanValue = getValueSchemaDefaultValue({ type: 'boolean' }); + expect(defaultBooleanValue).toEqual(false); + }); - test('duration', () => { - const defaultDurationValue = getValueSchemaDefaultValue({ type: 'duration' }); - expect(defaultDurationValue).toEqual(0); - }); + test('duration', () => { + const defaultDurationValue = getValueSchemaDefaultValue({ type: 'duration' }); + expect(defaultDurationValue).toEqual(0); + }); - test('int', () => { - const defaultIntValue = getValueSchemaDefaultValue({ type: 'int' }); - expect(defaultIntValue).toEqual(0); - }); + test('int', () => { + const defaultIntValue = getValueSchemaDefaultValue({ type: 'int' }); + expect(defaultIntValue).toEqual(0); + }); - test('path', () => { - const defaultPathValue = getValueSchemaDefaultValue({ type: 'path' }); - expect(defaultPathValue).toEqual(''); - }); + test('path', () => { + const defaultPathValue = getValueSchemaDefaultValue({ type: 'path' }); + expect(defaultPathValue).toEqual(''); + }); - test('real', () => { - const defaultRealValue = getValueSchemaDefaultValue({ type: 'real' }); - expect(defaultRealValue).toEqual(0); - }); + test('real', () => { + const defaultRealValue = getValueSchemaDefaultValue({ type: 'real' }); + expect(defaultRealValue).toEqual(0); + }); - test('series', () => { - const defaultSeriesValue = getValueSchemaDefaultValue({ items: { type: 'int' }, type: 'series' }); - expect(defaultSeriesValue).toEqual([0]); - }); + test('series', () => { + const defaultSeriesValue = getValueSchemaDefaultValue({ items: { type: 'int' }, type: 'series' }); + expect(defaultSeriesValue).toEqual([0]); + }); - test('struct', () => { - const defaultStructValue = getValueSchemaDefaultValue({ items: { foo: { type: 'string' } }, type: 'struct' }); - expect(defaultStructValue).toEqual({ foo: '' }); - }); + test('struct', () => { + const defaultStructValue = getValueSchemaDefaultValue({ items: { foo: { type: 'string' } }, type: 'struct' }); + expect(defaultStructValue).toEqual({ foo: '' }); + }); - test('string', () => { - const defaultStringValue = getValueSchemaDefaultValue({ type: 'string' }); - expect(defaultStringValue).toEqual(''); - }); + test('string', () => { + const defaultStringValue = getValueSchemaDefaultValue({ type: 'string' }); + expect(defaultStringValue).toEqual(''); + }); - test('variant', () => { - const defaultVariantValue = getValueSchemaDefaultValue({ type: 'variant', variants: [{ key: 'A', label: 'A' }] }); - expect(defaultVariantValue).toEqual('A'); - }); + test('variant', () => { + const defaultVariantValue = getValueSchemaDefaultValue({ type: 'variant', variants: [{ key: 'A', label: 'A' }] }); + expect(defaultVariantValue).toEqual('A'); }); +}); - test('Should return whether or not a form parameter is a recursive parameter or not', () => { +describe('isRecParameter', () => { + test('Should return true for a form parameter that is a recursive parameter', () => { expect( isRecParameter({ errors: [], @@ -188,4 +190,32 @@ describe('getArgument', () => { }), ).toEqual(false); }); + + test('Should return false for a form parameter that is not a recursive parameter', () => { + expect( + isRecParameter({ + errors: [], + name: 'test', + order: 0, + schema: { + type: 'string', + }, + value: 'foo', + valueSource: 'mission', + }), + ).toEqual(false); + + expect( + isRecParameter({ + errors: [], + name: 'test', + order: 0, + schema: { + type: 'boolean', + }, + value: 'foo', + valueSource: 'mission', + }), + ).toEqual(false); + }); });