backend/test/utils/translators/ldb/staffStation.utils.test.ts
Fred Boniface 68207d1e5e Add calculateLength() code
Signed-off-by: Fred Boniface <fred@fjla.uk>
2023-08-05 01:04:41 +01:00

23 lines
654 B
TypeScript

import { transform } from "../../../../src/utils/translators/ldb/staffStation";
import { inputs } from "./stationInputs";
import { outputs } from "./stationOutputs";
describe('transform', () => {
test('Should return null for empty input', () => {
const input = {};
expect(transform(input)).toBeNull();
});
for (const testNo in inputs) {
test(`Should correctly transform data ${testNo + 1}`, () => {
const input = inputs[testNo]
const expectedOutput = outputs[testNo]
expect(transform(input)).toEqual(expectedOutput);
});
}
});
// Write test for calculateLength(input: TrainServices): number | undefined