Deprecate old naming and introduce new words
This commit is contained in:
@@ -8,7 +8,7 @@ Please see LICENSE in the repository root for full details.
|
||||
import { test, vi } from "vitest";
|
||||
import { expect } from "vitest";
|
||||
|
||||
import { setOutputEnabled$ } from "../controls";
|
||||
import { setAudioEnabled$ } from "../controls";
|
||||
import { muteAllAudio as muteAllAudioSetting } from "../settings/settings";
|
||||
import { muteAllAudio$ } from "./MuteAllAudioModel";
|
||||
|
||||
@@ -18,19 +18,19 @@ test("muteAllAudio$", () => {
|
||||
valueMock(value);
|
||||
});
|
||||
|
||||
setOutputEnabled$.next(false);
|
||||
setOutputEnabled$.next(true);
|
||||
setAudioEnabled$.next(false);
|
||||
setAudioEnabled$.next(true);
|
||||
muteAllAudioSetting.setValue(false);
|
||||
muteAllAudioSetting.setValue(true);
|
||||
setOutputEnabled$.next(false);
|
||||
setAudioEnabled$.next(false);
|
||||
|
||||
muteAllAudio.unsubscribe();
|
||||
|
||||
expect(valueMock).toHaveBeenCalledTimes(6);
|
||||
expect(valueMock).toHaveBeenNthCalledWith(1, false); // startWith([false, muteAllAudioSetting.getValue()]);
|
||||
expect(valueMock).toHaveBeenNthCalledWith(2, true); // setOutputEnabled$.next(false);
|
||||
expect(valueMock).toHaveBeenNthCalledWith(3, false); // setOutputEnabled$.next(true);
|
||||
expect(valueMock).toHaveBeenNthCalledWith(2, true); // setAudioEnabled$.next(false);
|
||||
expect(valueMock).toHaveBeenNthCalledWith(3, false); // setAudioEnabled$.next(true);
|
||||
expect(valueMock).toHaveBeenNthCalledWith(4, false); // muteAllAudioSetting.setValue(false);
|
||||
expect(valueMock).toHaveBeenNthCalledWith(5, true); // muteAllAudioSetting.setValue(true);
|
||||
expect(valueMock).toHaveBeenNthCalledWith(6, true); // setOutputEnabled$.next(false);
|
||||
expect(valueMock).toHaveBeenNthCalledWith(6, true); // setAudioEnabled$.next(false);
|
||||
});
|
||||
|
||||
@@ -7,13 +7,13 @@ Please see LICENSE in the repository root for full details.
|
||||
|
||||
import { combineLatest, startWith } from "rxjs";
|
||||
|
||||
import { setOutputEnabled$ } from "../controls";
|
||||
import { setAudioEnabled$ } from "../controls";
|
||||
import { muteAllAudio as muteAllAudioSetting } from "../settings/settings";
|
||||
|
||||
/**
|
||||
* This can transition into sth more complete: `GroupCallViewModel.ts`
|
||||
*/
|
||||
export const muteAllAudio$ = combineLatest(
|
||||
[setOutputEnabled$.pipe(startWith(true)), muteAllAudioSetting.value$],
|
||||
[setAudioEnabled$.pipe(startWith(true)), muteAllAudioSetting.value$],
|
||||
(outputEnabled, settingsMute) => !outputEnabled || settingsMute,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user