Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-10-15 16:22:11 +01:00
parent d928a7be9d
commit 67659ab353
No known key found for this signature in database
GPG key ID: A2B008A5F49F5D0D
48 changed files with 4088 additions and 245 deletions

View file

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
import { act, fireEvent, render, screen, within } from "jest-matrix-react";
import { act, fireEvent, render, screen } from "jest-matrix-react";
import {
EventTimeline,
EventType,
@ -46,7 +46,7 @@ describe("PeopleRoomSettingsTab", () => {
</MatrixClientContext.Provider>,
);
const getGroup = () => screen.getByRole("group", { name: "Asking to join" });
const getParagraph = () => screen.getByRole("paragraph");
const getParagraph = () => document.querySelector("p");
it("renders a heading", () => {
getComponent(room);
@ -115,7 +115,7 @@ describe("PeopleRoomSettingsTab", () => {
it("allows to expand a reason", () => {
getComponent(room);
fireEvent.click(getButton("See more"));
expect(within(getGroup()).getByRole("paragraph")).toHaveTextContent(reason);
expect(getGroup().querySelector("p")).toHaveTextContent(reason);
});
it("allows to collapse a reason", () => {