diff --git a/test/contract/private.write.test.ts b/test/contract/private.write.test.ts index 9e42db3..dd3dee1 100644 --- a/test/contract/private.write.test.ts +++ b/test/contract/private.write.test.ts @@ -33,8 +33,10 @@ describe('Private Contract REST API POST Endpoints', () => { price: '20000', orderLinkId: Date.now().toString(), timeInForce: 'GoodTillCancel', + positionIdx: '2', }) ).toMatchObject({ + // retMsg: '', retCode: API_ERROR_CODE.CONTRACT_INSUFFICIENT_BALANCE, }); }); @@ -74,6 +76,7 @@ describe('Private Contract REST API POST Endpoints', () => { autoAddMargin: 0, side: 'Buy', symbol, + positionIdx: 1, }) ).toMatchObject({ retMsg: expect.stringMatching(/not modified/gim), @@ -98,7 +101,7 @@ describe('Private Contract REST API POST Endpoints', () => { expect( await api.setPositionMode({ symbol, - mode: 0, + mode: 3, }) ).toMatchObject({ retCode: API_ERROR_CODE.CONTRACT_POSITION_MODE_NOT_MODIFIED, @@ -120,7 +123,7 @@ describe('Private Contract REST API POST Endpoints', () => { it('setTPSL()', async () => { expect( - await api.setTPSL({ symbol, positionIdx: 0, stopLoss: '100' }) + await api.setTPSL({ symbol, positionIdx: 1, stopLoss: '100' }) ).toMatchObject({ retMsg: expect.stringMatching(/zero position/gim), retCode: API_ERROR_CODE.PARAMS_MISSING_OR_WRONG, @@ -128,7 +131,8 @@ describe('Private Contract REST API POST Endpoints', () => { }); it('setRiskLimit()', async () => { - expect(await api.setRiskLimit(symbol, 43, 0)).toMatchObject({ + expect(await api.setRiskLimit(symbol, 43, 2)).toMatchObject({ + // retMsg: '', retCode: API_ERROR_CODE.CONTRACT_RISK_LIMIT_INFO_NOT_EXISTS, }); }); diff --git a/test/contract/ws.private.test.ts b/test/contract/ws.private.test.ts index 162c803..49937e6 100644 --- a/test/contract/ws.private.test.ts +++ b/test/contract/ws.private.test.ts @@ -23,7 +23,7 @@ describe('Private Contract Websocket Client', () => { secret: API_SECRET, }; - beforeAll(async () => { + beforeAll(() => { wsClient = new WebsocketClient( wsClientOptions, getSilentLogger('expectSuccessNoAuth') diff --git a/test/linear/private.write.test.ts b/test/linear/private.write.test.ts index 424420b..fb82088 100644 --- a/test/linear/private.write.test.ts +++ b/test/linear/private.write.test.ts @@ -176,7 +176,7 @@ describe('Private Linear REST API POST Endpoints', () => { margin: 5, }) ).toMatchObject({ - ret_code: API_ERROR_CODE.POSITION_SIZE_IS_ZERO, + ret_code: API_ERROR_CODE.ISOLATED_NOT_MODIFIED_LINEAR, }); });