mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-12-05 11:38:00 +00:00
c09f572fa7
* 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
25 lines
784 B
TypeScript
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);
|
|
});
|
|
});
|