Files
blap/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListSectionHeaderView/RoomListSectionHeaderView.test.tsx
T
Zack a7cd6eac31 Shared Components Restructure, Cherry Picked | Restructure Room-List Tree (#32915)
* refactor(shared-components): restructure room-list tree

* refactor(web): rename room-list parent viewmodel

* test(shared-components): add room-list visual baselines

* fix(room-list): address review feedback

* Fix Prettier

* Move AvatarWithDetails from avatar folder to core

* Update stories title to reflect correct path

* Fix AvatarWithDetails barrel export path

* Remove stale DateSeparatorView barrel export

* Move AvatarWithDetails visual baseline

* Shorten shared-components visual snapshot paths

* Revert "Shorten shared-components visual snapshot paths"

This reverts commit 91880ff5fb10408aa0091175b53ce3c86c6975a9.

* Move room list notification decoration files up a level
2026-04-14 08:51:36 +00:00

33 lines
1.1 KiB
TypeScript

/*
* Copyright 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
import React from "react";
import { render } from "@test-utils";
import { composeStories } from "@storybook/react-vite";
import { describe, it, expect } from "vitest";
import userEvent from "@testing-library/user-event";
import * as stories from "./RoomListSectionHeaderView.stories";
const { Default } = composeStories(stories);
describe("<RoomListSectionHeaderView /> stories", () => {
it("renders Default story", () => {
const { container } = render(<Default />);
expect(container).toMatchSnapshot();
});
it("should call onClick when the header is clicked", async () => {
const user = userEvent.setup();
const { getByRole } = render(<Default />);
const button = getByRole("gridcell", { name: "Toggle Favourites section" });
await user.click(button);
expect(Default.args.onClick).toHaveBeenCalled();
});
});