mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-24 19:19:21 +00:00
Add tests for developer mode to device label
This commit is contained in:
@@ -42,7 +42,10 @@ import {
|
|||||||
import { E2eeType } from "../e2ee/e2eeType";
|
import { E2eeType } from "../e2ee/e2eeType";
|
||||||
import { getBasicCallViewModelEnvironment } from "../utils/test-viewmodel";
|
import { getBasicCallViewModelEnvironment } from "../utils/test-viewmodel";
|
||||||
import { alice, local } from "../utils/test-fixtures";
|
import { alice, local } from "../utils/test-fixtures";
|
||||||
import { useExperimentalToDeviceTransport as useExperimentalToDeviceTransportSetting } from "../settings/settings";
|
import {
|
||||||
|
developerMode as developerModeSetting,
|
||||||
|
useExperimentalToDeviceTransport as useExperimentalToDeviceTransportSetting,
|
||||||
|
} from "../settings/settings";
|
||||||
import { ReactionsSenderProvider } from "../reactions/useReactionsSender";
|
import { ReactionsSenderProvider } from "../reactions/useReactionsSender";
|
||||||
import { useRoomEncryptionSystem } from "../e2ee/sharedKeyManagement";
|
import { useRoomEncryptionSystem } from "../e2ee/sharedKeyManagement";
|
||||||
|
|
||||||
@@ -201,6 +204,7 @@ describe("InCallView", () => {
|
|||||||
kind: E2eeType.PER_PARTICIPANT,
|
kind: E2eeType.PER_PARTICIPANT,
|
||||||
});
|
});
|
||||||
useExperimentalToDeviceTransportSetting.setValue(true);
|
useExperimentalToDeviceTransportSetting.setValue(true);
|
||||||
|
developerModeSetting.setValue(true);
|
||||||
const { getByText } = createInCallView();
|
const { getByText } = createInCallView();
|
||||||
expect(getByText("using to Device key transport")).toBeInTheDocument();
|
expect(getByText("using to Device key transport")).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
@@ -210,6 +214,7 @@ describe("InCallView", () => {
|
|||||||
kind: E2eeType.NONE,
|
kind: E2eeType.NONE,
|
||||||
});
|
});
|
||||||
useExperimentalToDeviceTransportSetting.setValue(true);
|
useExperimentalToDeviceTransportSetting.setValue(true);
|
||||||
|
developerModeSetting.setValue(true);
|
||||||
const { queryByText } = createInCallView();
|
const { queryByText } = createInCallView();
|
||||||
expect(
|
expect(
|
||||||
queryByText("using to Device key transport"),
|
queryByText("using to Device key transport"),
|
||||||
@@ -221,6 +226,7 @@ describe("InCallView", () => {
|
|||||||
kind: E2eeType.PER_PARTICIPANT,
|
kind: E2eeType.PER_PARTICIPANT,
|
||||||
});
|
});
|
||||||
useExperimentalToDeviceTransportSetting.setValue(true);
|
useExperimentalToDeviceTransportSetting.setValue(true);
|
||||||
|
developerModeSetting.setValue(true);
|
||||||
const { rtcSession, queryByText } = createInCallView();
|
const { rtcSession, queryByText } = createInCallView();
|
||||||
expect(queryByText("using to Device key transport")).toBeInTheDocument();
|
expect(queryByText("using to Device key transport")).toBeInTheDocument();
|
||||||
expect(rtcSession).toBeDefined();
|
expect(rtcSession).toBeDefined();
|
||||||
@@ -236,7 +242,18 @@ describe("InCallView", () => {
|
|||||||
});
|
});
|
||||||
it("is not shown if setting is disabled", () => {
|
it("is not shown if setting is disabled", () => {
|
||||||
useExperimentalToDeviceTransportSetting.setValue(false);
|
useExperimentalToDeviceTransportSetting.setValue(false);
|
||||||
|
developerModeSetting.setValue(true);
|
||||||
|
useRoomEncryptionSystemMock.mockReturnValue({
|
||||||
|
kind: E2eeType.PER_PARTICIPANT,
|
||||||
|
});
|
||||||
|
const { queryByText } = createInCallView();
|
||||||
|
expect(
|
||||||
|
queryByText("using to Device key transport"),
|
||||||
|
).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
|
it("is not shown if developer mode is disabled", () => {
|
||||||
|
useExperimentalToDeviceTransportSetting.setValue(true);
|
||||||
|
developerModeSetting.setValue(false);
|
||||||
useRoomEncryptionSystemMock.mockReturnValue({
|
useRoomEncryptionSystemMock.mockReturnValue({
|
||||||
kind: E2eeType.PER_PARTICIPANT,
|
kind: E2eeType.PER_PARTICIPANT,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ import {
|
|||||||
debugTileLayout as debugTileLayoutSetting,
|
debugTileLayout as debugTileLayoutSetting,
|
||||||
useExperimentalToDeviceTransport as useExperimentalToDeviceTransportSetting,
|
useExperimentalToDeviceTransport as useExperimentalToDeviceTransportSetting,
|
||||||
muteAllAudio as muteAllAudioSetting,
|
muteAllAudio as muteAllAudioSetting,
|
||||||
developerMode as settingsDeveloperMode,
|
developerMode as developerModeSetting,
|
||||||
useSetting,
|
useSetting,
|
||||||
} from "../settings/settings";
|
} from "../settings/settings";
|
||||||
import { ReactionsReader } from "../reactions/ReactionsReader";
|
import { ReactionsReader } from "../reactions/ReactionsReader";
|
||||||
@@ -235,7 +235,7 @@ export const InCallView: FC<InCallViewProps> = ({
|
|||||||
(enabled) => setDidFallbackToRoomKey(enabled.room),
|
(enabled) => setDidFallbackToRoomKey(enabled.room),
|
||||||
);
|
);
|
||||||
|
|
||||||
const [developerMode] = useSetting(settingsDeveloperMode);
|
const [developerMode] = useSetting(developerModeSetting);
|
||||||
const [useExperimentalToDeviceTransport] = useSetting(
|
const [useExperimentalToDeviceTransport] = useSetting(
|
||||||
useExperimentalToDeviceTransportSetting,
|
useExperimentalToDeviceTransportSetting,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user