Fix Web.JS tests (#12513)

This commit is contained in:
Steve Sanderson 2019-07-24 09:48:12 -07:00 committed by GitHub
parent 2029a0f3e4
commit dd0d483f7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,4 @@
import { DefaultReconnectDisplay } from "../src/Platform/Circuits/DefaultReconnectDisplay";
import { AutoReconnectCircuitHandler } from "../src/Platform/Circuits/AutoReconnectCircuitHandler";
import {JSDOM} from 'jsdom';
describe('DefaultReconnectDisplay', () => {

View File

@ -25,14 +25,15 @@ describe('RenderQueue', () => {
});
it('processBatch does not render previous batches', () => {
it('processBatch acknowledges previously rendered batches', () => {
const queue = RenderQueue.getOrCreateQueue(3, NullLogger.instance);
const sendMock = jest.fn();
const connection = { send: sendMock } as any as signalR.HubConnection;
queue.processBatch(1, new Uint8Array(0), connection);
queue.processBatch(2, new Uint8Array(0), connection);
expect(sendMock.mock.calls.length).toEqual(0);
expect(sendMock.mock.calls.length).toEqual(1);
expect(queue.getLastBatchid()).toEqual(2);
});
it('processBatch does not render out of order batches', () => {