Skip to content

Commit

Permalink
fix: fix test for utils.test.ts #none
Browse files Browse the repository at this point in the history
Signed-off-by: James <james@union.ai>
  • Loading branch information
james-union authored and anrusina committed May 27, 2022
1 parent d74a3ab commit 47e3d9c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export const supportedPrimitives: InputTypeDefinition[] = [
inputTypes.integer,
inputTypes.schema,
inputTypes.struct,
inputTypes.map,
];

export const unsupportedTypes: InputTypeDefinition[] = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
collectionInputTypeDefinition,
mapInputTypeDefinition,
nestedCollectionInputTypeDefinition,
nestedMapInputTypeDefinition,
} from '../../__mocks__/utils';
import { InputTypeDefinition } from '../../types';
import { typeIsSupported } from '../utils';
Expand All @@ -25,6 +27,16 @@ describe('Launch/inputHelpers/utils', () => {
nestedCollectionInputTypeDefinition(typeDefinition),
true,
]),
...supportedPrimitives.map<TypeIsSupportedTestCase>((typeDefinition) => [
`supports 1-dimension map of type ${typeDefinition.type}`,
mapInputTypeDefinition(typeDefinition),
true,
]),
...supportedPrimitives.map<TypeIsSupportedTestCase>((typeDefinition) => [
`supports 2-dimension map of type: ${typeDefinition.type}`,
nestedMapInputTypeDefinition(typeDefinition),
true,
]),
...unsupportedTypes.map<TypeIsSupportedTestCase>((typeDefinition) => [
`does NOT support type ${typeDefinition.type}`,
typeDefinition,
Expand All @@ -40,6 +52,16 @@ describe('Launch/inputHelpers/utils', () => {
nestedCollectionInputTypeDefinition(typeDefinition),
false,
]),
...unsupportedTypes.map<TypeIsSupportedTestCase>((typeDefinition) => [
`does NOT support 1-dimension map of type ${typeDefinition.type}`,
mapInputTypeDefinition(typeDefinition),
false,
]),
...unsupportedTypes.map<TypeIsSupportedTestCase>((typeDefinition) => [
`does NOT support 2-dimension map of type: ${typeDefinition.type}`,
nestedMapInputTypeDefinition(typeDefinition),
false,
]),
];

cases.forEach(([description, value, expected]) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const datetimeInputName = 'simpleDatetime';
export const integerInputName = 'simpleInteger';
export const binaryInputName = 'simpleBinary';
export const errorInputName = 'simpleError';
export const mapInputName = 'simpleMap';

export const iamRoleString = 'arn:aws:iam::12345678:role/defaultrole';
export const k8sServiceAccountString = 'default-service-account';

0 comments on commit 47e3d9c

Please sign in to comment.