-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrating.test.js
More file actions
21 lines (18 loc) · 685 Bytes
/
rating.test.js
File metadata and controls
21 lines (18 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const { getRating } = require('./rating');
describe('rating', () => {
it('should return 1 if the driver has less than five late deliveries', () => {
const driver = { numberOfLateDeliveries: 4 };
const rating = getRating(driver);
expect(rating).toEqual(1);
});
it('should return 1 if the driver has five late deliveries', () => {
const driver = { numberOfLateDeliveries: 5 };
const rating = getRating(driver);
expect(rating).toEqual(1);
});
it('should return 2 if the driver has more than five late deliveries', () => {
const driver = { numberOfLateDeliveries: 6 };
const rating = getRating(driver);
expect(rating).toEqual(2);
});
});