forked from DAVFoundation/dav-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMissionParams.test.js
36 lines (35 loc) · 1.4 KB
/
MissionParams.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const MissionParams_1 = require("./MissionParams");
describe('MissionParams class', () => {
let missionParams;
let serializedMissionParams;
beforeEach(() => {
missionParams = new MissionParams_1.default({});
serializedMissionParams = {
ttl: undefined,
protocol: 'ride_hailing',
type: 'mission',
price: undefined,
vehicleId: undefined,
};
});
describe('serialize method', () => {
it('should return serialized MissionParams object with the current values', () => {
expect(missionParams.serialize()).toEqual(serializedMissionParams);
});
});
describe('deserialize method', () => {
it('should return a MissionParams instance', () => {
const missionParamsObject = new MissionParams_1.default();
missionParamsObject.deserialize(serializedMissionParams);
expect(missionParamsObject).toBeInstanceOf(MissionParams_1.default);
});
it('should return a correct MissionParams object', () => {
const missionParamsObject = new MissionParams_1.default({});
missionParamsObject.deserialize(serializedMissionParams);
expect(missionParamsObject).toEqual(missionParams);
});
});
});
//# sourceMappingURL=MissionParams.test.js.map