mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-05 22:25:36 +00:00
Respect UIFeature.Voip (#29873)
* respect UIFeature.Voip * Add unit tests * reset sdk and mocks * Update RoomHeader-test.tsx.snap * use useSettingValue * lint
This commit is contained in:
@@ -226,6 +226,37 @@ describe("RoomHeader", () => {
|
||||
expect(screen.queryByRole("button", { name: "Voice call" })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
describe("UIFeature.Voip disabled", () => {
|
||||
beforeEach(() => {
|
||||
SdkConfig.put({
|
||||
setting_defaults: {
|
||||
[UIFeature.Voip]: false,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
SdkConfig.reset();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it("should not show call buttons in rooms smaller than 3 members", async () => {
|
||||
mockRoomMembers(room, 2);
|
||||
render(<RoomHeader room={room} />, getWrapper());
|
||||
|
||||
expect(screen.queryByRole("button", { name: "Video call" })).not.toBeInTheDocument();
|
||||
expect(screen.queryByRole("button", { name: "Voice call" })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("should not show call button in rooms larger than 2 members", async () => {
|
||||
mockRoomMembers(room, 3);
|
||||
render(<RoomHeader room={room} />, getWrapper());
|
||||
|
||||
expect(screen.queryByRole("button", { name: "Video call" })).not.toBeInTheDocument();
|
||||
expect(screen.queryByRole("button", { name: "Voice call" })).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe("UIFeature.Widgets enabled (default)", () => {
|
||||
beforeEach(() => {
|
||||
SdkConfig.put({
|
||||
|
||||
Reference in New Issue
Block a user