mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
test(voice): build watch attempt keys from the shared builder (#2693)
This commit is contained in:
1 parent
2e3f78b3c6
commit
cadca2c18e
2 files changed
+7
-5
No files matched your search
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {screenShareWatchAttemptKey} from '@app/features/voice/components/useScreenShareWatchFailure';
|
||||
import {
|
||||
selectVoiceMediaGraphFailure,
|
||||
selectVoiceMediaGraphViewerStreamKeys,
|
||||
@@ -101,7 +102,7 @@ describe('VoiceMediaGraphTimerScheduler', () => {
|
||||
store.transition({
|
||||
type: 'watch.attemptEnsured',
|
||||
streamKey: STREAM_KEY,
|
||||
attemptKey: `${STREAM_KEY}:1:watch`,
|
||||
attemptKey: screenShareWatchAttemptKey({streamKey: STREAM_KEY, watchGeneration: 1}),
|
||||
startedAt: store.nowMs(),
|
||||
});
|
||||
harness.advance(WATCH_ATTEMPT_TIMEOUT_MS);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {screenShareWatchAttemptKey} from '@app/features/voice/components/useScreenShareWatchFailure';
|
||||
import {voiceMediaGraphStore} from '@app/features/voice/engine/VoiceMediaGraphStore';
|
||||
import {ScreenShareWatchErrorCode, ScreenShareWatchFailures} from '@app/features/voice/state/ScreenShareWatchFailures';
|
||||
import type {RemoteTrackPublication} from 'livekit-client';
|
||||
@@ -104,7 +105,7 @@ describe('ScreenShareWatchFailures failure history', () => {
|
||||
|
||||
it('keeps a failure raised by a watch deadline after the viewer stops watching', () => {
|
||||
const streamKey = 'guild-a:channel-a:connection-deadline';
|
||||
const attemptKey = `${streamKey}:1:watch`;
|
||||
const attemptKey = screenShareWatchAttemptKey({streamKey, watchGeneration: 1});
|
||||
ScreenShareWatchFailures.markWatchStarted(streamKey);
|
||||
ScreenShareWatchFailures.ensureAttempt({streamKey}, attemptKey);
|
||||
ScreenShareWatchFailures.setWatchTarget(streamKey, {videoRef: {current: null}});
|
||||
@@ -122,7 +123,7 @@ describe('ScreenShareWatchFailures failure history', () => {
|
||||
|
||||
it('records the inbound counters of the watched publication alongside the failure', async () => {
|
||||
const streamKey = 'guild-a:channel-a:connection-counters';
|
||||
const attemptKey = `${streamKey}:1:watch`;
|
||||
const attemptKey = screenShareWatchAttemptKey({streamKey, watchGeneration: 1});
|
||||
ScreenShareWatchFailures.markWatchStarted(streamKey);
|
||||
ScreenShareWatchFailures.ensureAttempt({streamKey}, attemptKey);
|
||||
ScreenShareWatchFailures.setWatchTarget(streamKey, {
|
||||
@@ -160,7 +161,7 @@ describe('ScreenShareWatchFailures failure history', () => {
|
||||
|
||||
it('records the size and readiness of the attached video element', () => {
|
||||
const streamKey = 'guild-a:channel-a:connection-tile';
|
||||
const attemptKey = `${streamKey}:1:watch`;
|
||||
const attemptKey = screenShareWatchAttemptKey({streamKey, watchGeneration: 1});
|
||||
const video = {readyState: 0, videoWidth: 0, videoHeight: 0, clientWidth: 960, clientHeight: 540};
|
||||
ScreenShareWatchFailures.markWatchStarted(streamKey);
|
||||
ScreenShareWatchFailures.ensureAttempt({streamKey}, attemptKey);
|
||||
@@ -186,7 +187,7 @@ describe('ScreenShareWatchFailures failure history', () => {
|
||||
|
||||
it('leaves the running watch deadline alone when the watch target is registered', () => {
|
||||
const streamKey = 'guild-a:channel-a:connection-target';
|
||||
const attemptKey = `${streamKey}:1:watch`;
|
||||
const attemptKey = screenShareWatchAttemptKey({streamKey, watchGeneration: 1});
|
||||
ScreenShareWatchFailures.markWatchStarted(streamKey);
|
||||
ScreenShareWatchFailures.ensureAttempt({streamKey}, attemptKey);
|
||||
const deadline = watchDeadlineFor(streamKey);
|
||||
|
||||
Reference in new issue
Block a user