Skip to content

Commit b51807e

Browse files
ZIMkaRUJacobPlaster
authored andcommitted
Add test coverage for min and max clamp
1 parent 4739b52 commit b51807e

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

test/lib/models/status_messages_deriv.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ describe('Derivatives Status Message model', () => {
1313
model: StatusMessagesDeriv,
1414
orderedFields: [
1515
'key', 'timestamp', null, 'price', 'priceSpot', null, 'fundBal', null,
16-
null, 'fundingAccrued', 'fundingStep'
16+
null, 'fundingAccrued', 'fundingStep', null, null, null, null, null,
17+
null, null, null, null, null, null, 'clampMin', 'clampMax'
1718
]
1819
})
1920

@@ -22,11 +23,13 @@ describe('Derivatives Status Message model', () => {
2223
validData: {
2324
key: VALID_STRINGS, // pull data from somewhere
2425
timestamp: VALID_STRINGS, // pull data from somewhere
25-
price: new Array(...(new Array(5))).map(() => Math.random()),
26-
priceSpot: new Array(...(new Array(5))).map(() => Math.random()),
27-
fundBal: new Array(...(new Array(5))).map(() => Math.random()),
28-
fundingAccrued: new Array(...(new Array(5))).map(() => Math.random()),
29-
fundingStep: new Array(...(new Array(5))).map(() => Math.random())
26+
price: new Array(5).fill().map(Math.random),
27+
priceSpot: new Array(5).fill().map(Math.random),
28+
fundBal: new Array(5).fill().map(Math.random),
29+
fundingAccrued: new Array(5).fill().map(Math.random),
30+
fundingStep: new Array(5).fill().map(Math.random),
31+
clampMin: new Array(5).fill().map(Math.random),
32+
clampMax: new Array(5).fill().map(Math.random)
3033
}
3134
})
3235
})

0 commit comments

Comments
 (0)