Skip to content

Commit

Permalink
fix: removed optional for taxon body location
Browse files Browse the repository at this point in the history
  • Loading branch information
MacQSL committed Dec 20, 2024
1 parent db6c944 commit c138cf2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class ImportMarkingsService extends DBService {
ALIAS: { aliases: ['NICKNAME', 'ANIMAL'] },
CAPTURE_DATE: { aliases: ['CAPTURE DATE', 'DATE'] },
CAPTURE_TIME: { aliases: ['CAPTURE TIME', 'TIME'], optional: true },
BODY_LOCATION: { aliases: ['BODY LOCATION'], optional: true },
BODY_LOCATION: { aliases: ['BODY LOCATION'] },
MARKING_TYPE: { aliases: ['MARKING TYPE', 'TYPE'], optional: true },
IDENTIFIER: { aliases: ['ID'], optional: true },
PRIMARY_COLOUR: { aliases: ['PRIMARY COLOUR'], optional: true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,6 @@ describe('marking-header-configs', () => {
expect(result).to.deep.equal([]);
});

it('should return no errors for undefined', () => {
const cellValidator = getMarkingBodyLocationCellValidator(new Map(), new NestedRecord(), {} as any);

const result = cellValidator({ cell: undefined } as CSVParams);

expect(result).to.deep.equal([]);
});

it('should return no errors when alias does not map to a survey critter', () => {
const dictionary = new NestedRecord({ 1: { location: 'uuid' } });
const surveyAliasMap: any = new Map([['alias', { itis_tsn: 1 }]]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ export const getMarkingBodyLocationCellValidator = (
utils: CSVConfigUtils<MarkingCSVStaticHeader>
): CSVCellValidator => {
return (params: CSVParams) => {
if (params.cell === undefined) {
return [];
}

const rowAlias = String(utils.getCellValue('ALIAS', params.row));
const aliasTsn = surveyAliasMap.get(rowAlias.toLowerCase())?.itis_tsn;

Expand Down

0 comments on commit c138cf2

Please sign in to comment.