From 88f4b889a193f775ec5a2af5644a67729c3c9dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 26 Oct 2022 10:48:34 +0200 Subject: [PATCH] Add `CallList` test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- test/home/CallList-test.tsx | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 test/home/CallList-test.tsx diff --git a/test/home/CallList-test.tsx b/test/home/CallList-test.tsx new file mode 100644 index 0000000..a0dba2c --- /dev/null +++ b/test/home/CallList-test.tsx @@ -0,0 +1,46 @@ +/* +Copyright 2022 New Vector Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import React from "react"; + +import { render, RenderResult } from "@testing-library/react"; +import { CallList } from "../../src/home/CallList"; +import { MatrixClient } from "matrix-js-sdk"; +import { GroupCallRoom } from "../../src/home/useGroupCallRooms"; +import { MemoryRouter } from "react-router-dom"; +import { ClientProvider } from "../../src/ClientContext"; + +describe("CallList", () => { + const renderComponent = (rooms: GroupCallRoom[]): RenderResult => { + return render( + + + + + + ); + }; + + it("should show room", async () => { + const rooms = [ + { roomName: "Room #1", roomId: "!roomId" }, + ] as GroupCallRoom[]; + + const result = renderComponent(rooms); + + expect(result.queryByText("Room #1")).toBeTruthy(); + }); +});