Files
healthchat-web/apps/web/src/autocomplete/Components.test.tsx
T
David Baker c09f572fa7 Add user status to autocomplete suggestion (#34241)
* Add user status to autocomplete suggestion

* Add test for PillCompletion titleIcon

* Convert to vitest

* Add test for UserStatusIcon

* Switch the user status icon view to be a view model based component

* Screenshots

* Add .catch

* Add test for UserProvider
2026-07-14 13:47:24 +00:00

25 lines
784 B
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.
*/
// @vitest-environment happy-dom
import React from "react";
import { render, screen } from "test-utils-rtl";
import { describe, it, expect } from "vitest";
import { PillCompletion } from "./Components";
describe("PillCompletion", () => {
it("renders the titleIcon immediately after the title", () => {
render(<PillCompletion title="Alice" titleIcon={<span>💡</span>} description="@alice:example.org" />);
const title = screen.getByText("Alice");
const icon = screen.getByText("💡");
expect(title.nextElementSibling).toBe(icon);
});
});