tests for unified margin WS
This commit is contained in:
@@ -44,16 +44,18 @@ describe('Public Unified Margin Websocket Client (Perps - USDT)', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('should subscribe to public trade events through USDT topic', async () => {
|
||||
it('should subscribe to public orderbook events through USDT connection', async () => {
|
||||
const wsResponsePromise = waitForSocketEvent(wsClient, 'response');
|
||||
const wsUpdatePromise = waitForSocketEvent(wsClient, 'update');
|
||||
|
||||
wsClient.subscribe('orderbook.25.BTCUSDT');
|
||||
// USDT should be detected and automatically routed through the USDT connection
|
||||
const topic = 'orderbook.25.BTCUSDT';
|
||||
wsClient.subscribe(topic);
|
||||
|
||||
try {
|
||||
expect(await wsResponsePromise).toMatchObject({
|
||||
op: 'subscribe',
|
||||
req_id: 'orderbook.25.BTCUSDT',
|
||||
req_id: topic,
|
||||
success: true,
|
||||
wsKey: WS_KEY_MAP.unifiedPerpUSDTPublic,
|
||||
});
|
||||
@@ -70,7 +72,7 @@ describe('Public Unified Margin Websocket Client (Perps - USDT)', () => {
|
||||
s: 'BTCUSDT',
|
||||
u: expect.any(Number),
|
||||
},
|
||||
topic: 'orderbook.25.BTCUSDT',
|
||||
topic: topic,
|
||||
ts: expect.any(Number),
|
||||
type: 'snapshot',
|
||||
wsKey: WS_KEY_MAP.unifiedPerpUSDTPublic,
|
||||
|
||||
Reference in New Issue
Block a user