Slide 147
Slide 147 text
it('should update the order', () => {
const order = {id: 1, price: 1.12, active: true};
const currentTickPrice = 1.11;
expect(updateOrder(order, currentTickPrice)).toEqual(UPDATE);
});
it('should do nothing', () => {
const order = {id: 1, price: 1.12, active: true};
const currentTickPrice = 1.12;
expect(updateOrder(order, currentTickPrice)).toEqual(DO_NOTHING);
});
it('should cancel the order', () => {
const order = {id: 1, price: 1.12, active: true};
const currentTickPrice = 1.22;
expect(updateOrder(order, currentTickPrice)).toEqual(CANCEL);
});
it('should NOT update the order', () => {
const order = {id: 1, price: 1.12, active: true};
const currentTickPrice = 1.11;
expect(updateOrder(order, currentTickPrice)).toEqual(UPDATE);
});
it('should NOT do nothing', () => {
const order = {id: 1, price: 1.12, active: true};
const currentTickPrice = 1.12;
expect(updateOrder(order, currentTickPrice)).toEqual(DO_NOTHING);
});
it('should NOT cancel the order', () => {
const order = {id: 1, price: 1.12, active: true};
const currentTickPrice = 1.22;
expect(updateOrder(order, currentTickPrice)).toEqual(CANCEL);
});