Skip to content

Commit

Permalink
fix merge conflict error
Browse files Browse the repository at this point in the history
  • Loading branch information
duranb committed Aug 16, 2023
1 parent 8c1693a commit fae5dfb
Showing 1 changed file with 68 additions and 38 deletions.
106 changes: 68 additions & 38 deletions src/utilities/parameters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down Expand Up @@ -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);
});
});

0 comments on commit fae5dfb

Please sign in to comment.