mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-17 13:23:35 +00:00
import id's from sheet (#1516)
* import id's from sheet * fix test * fix test in utils * remove comment * ensure uri safe ids
This commit is contained in:
committed by
GitHub
parent
e90161aa33
commit
d0b4c6a279
@@ -3,7 +3,7 @@ import { isImportMap } from '../spreadsheetImport';
|
||||
|
||||
describe('isImportMap()', () => {
|
||||
it('validates a v3 default import map', () => {
|
||||
const v3ImportMap = {
|
||||
const v3ImportMap: ImportMap = {
|
||||
worksheet: 'event schedule',
|
||||
timeStart: 'time start',
|
||||
linkStart: 'link start',
|
||||
@@ -21,13 +21,38 @@ describe('isImportMap()', () => {
|
||||
timeWarning: 'warning time',
|
||||
timeDanger: 'danger time',
|
||||
custom: {},
|
||||
} as ImportMap;
|
||||
entryId: 'id',
|
||||
};
|
||||
|
||||
expect(isImportMap(v3ImportMap)).toBe(true);
|
||||
});
|
||||
|
||||
it('rejects map missing keys', () => {
|
||||
const importMap = {
|
||||
worksheet: 'event schedule',
|
||||
timeStart: 'time start',
|
||||
linkStart: 'link start',
|
||||
timeEnd: 'time end',
|
||||
duration: 'duration',
|
||||
cue: 'cue',
|
||||
title: 'title',
|
||||
countToEnd: 'count to end',
|
||||
isPublic: 'public',
|
||||
skip: 'skip',
|
||||
note: 'notes',
|
||||
colour: 'colour',
|
||||
endAction: 'end action',
|
||||
timerType: 'timer type',
|
||||
timeWarning: 'warning time',
|
||||
timeDanger: 'danger time',
|
||||
custom: {},
|
||||
};
|
||||
|
||||
expect(isImportMap(importMap)).toBe(false);
|
||||
});
|
||||
|
||||
it('handles custom properties', () => {
|
||||
const v3ImportMap = {
|
||||
const v3ImportMap: ImportMap = {
|
||||
worksheet: 'event schedule',
|
||||
timeStart: 'time start',
|
||||
linkStart: 'link start',
|
||||
@@ -48,7 +73,8 @@ describe('isImportMap()', () => {
|
||||
userDefined: 'userDefined',
|
||||
anotherOne: 'anotherOne',
|
||||
},
|
||||
} as ImportMap;
|
||||
entryId: 'id',
|
||||
};
|
||||
|
||||
expect(isImportMap(v3ImportMap)).toBe(true);
|
||||
});
|
||||
|
||||
@@ -21,6 +21,7 @@ export const defaultImportMap = {
|
||||
timeWarning: 'warning time',
|
||||
timeDanger: 'danger time',
|
||||
custom: {},
|
||||
entryId: 'id',
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user