test: improve utils coverage (#4230)
* test: improve utils coverage * refactor: review - rename isDefined to isNonNullable, update tests and return statement
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { BoardFieldDefinition } from '@/object-record/record-board-deprecated/types/BoardFieldDefinition';
|
||||
import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata';
|
||||
import { assertNotNull } from '~/utils/assert';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
|
||||
import { ViewField } from '../types/ViewField';
|
||||
|
||||
@ -28,5 +28,5 @@ export const mapViewFieldsToBoardFieldDefinitions = (
|
||||
}
|
||||
: null;
|
||||
})
|
||||
.filter(assertNotNull);
|
||||
.filter(isNonNullable);
|
||||
};
|
||||
|
||||
@ -2,7 +2,7 @@ import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata'
|
||||
import { ColumnDefinition } from '@/object-record/record-table/types/ColumnDefinition';
|
||||
import { mapArrayToObject } from '~/utils/array/mapArrayToObject';
|
||||
import { moveArrayItem } from '~/utils/array/moveArrayItem';
|
||||
import { assertNotNull } from '~/utils/assert';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
|
||||
import { ViewField } from '../types/ViewField';
|
||||
|
||||
@ -48,7 +48,7 @@ export const mapViewFieldsToColumnDefinitions = ({
|
||||
viewFieldId: viewField.id,
|
||||
};
|
||||
})
|
||||
.filter(assertNotNull);
|
||||
.filter(isNonNullable);
|
||||
|
||||
// No label identifier set for this object
|
||||
if (!labelIdentifierFieldMetadataId) return columnDefinitionsFromViewFields;
|
||||
|
||||
Reference in New Issue
Block a user