Release 2.6.7
This commit is contained in:
@@ -38,7 +38,13 @@ function waitFor(predicate, timeoutMs = 1000) {
|
||||
test('player runtime snapshots websocket state and checks live names', async () => {
|
||||
process.env.PULSE_SIGNAGE_SHARED_SECRET = 'runtime-secret';
|
||||
|
||||
const runtime = createPlayerRuntime({ pool: null });
|
||||
const snapshotNotifications = [];
|
||||
const runtime = createPlayerRuntime({
|
||||
pool: null,
|
||||
notifySnapshot(snapshot) {
|
||||
snapshotNotifications.push(snapshot);
|
||||
}
|
||||
});
|
||||
const server = http.createServer();
|
||||
runtime.installWebsocket(server);
|
||||
|
||||
@@ -70,6 +76,7 @@ test('player runtime snapshots websocket state and checks live names', async ()
|
||||
const snapshot = runtime.snapshotConnections('test2')[0];
|
||||
return snapshot && snapshot.clientName === 'Lobby Player' ? snapshot : null;
|
||||
});
|
||||
await waitFor(() => snapshotNotifications.length > 0);
|
||||
const snapshot = runtime.snapshotConnections('test2')[0];
|
||||
|
||||
assert.equal(snapshot.clientName, 'Lobby Player');
|
||||
@@ -78,6 +85,8 @@ test('player runtime snapshots websocket state and checks live names', async ()
|
||||
assert.equal(snapshot.paused, true);
|
||||
assert.equal(snapshot.currentSlideId, 9);
|
||||
assert.equal(snapshot.currentSlideTitle, 'Intro');
|
||||
assert.equal(snapshotNotifications[0].slug, 'test2');
|
||||
assert.equal(snapshotNotifications[0].connections.length, 1);
|
||||
assert.equal(await runtime.isClientNameAvailableOnScreen(null, 'Lobby Player', 'other-device'), false);
|
||||
assert.equal(await runtime.isClientNameAvailableOnScreen(null, 'Lobby Player', 'device123'), true);
|
||||
assert.equal(await runtime.isClientNameAvailableOnScreen(null, 'Other Name', 'device123'), true);
|
||||
|
||||
Reference in New Issue
Block a user