mirror of
https://github.com/vector-im/element-web.git
synced 2026-04-03 04:32:36 +02:00
* Update to Module API v1.11.0 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Remove stale state field to make CQL happy Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Bump npm dep Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Improve coverage Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Improve coverage Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update comment Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
25 lines
856 B
TypeScript
25 lines
856 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.
|
|
*/
|
|
|
|
import { CustomisationsApi } from "../../../src/modules/customisationsApi";
|
|
import { UIComponent } from "../../../src/settings/UIFeature.ts";
|
|
|
|
describe("CustomisationsApi", () => {
|
|
let api: CustomisationsApi;
|
|
|
|
beforeEach(() => {
|
|
api = new CustomisationsApi();
|
|
});
|
|
|
|
it("should register a shouldShowComponent callback", () => {
|
|
const shouldShowComponent = jest.fn().mockReturnValue(true);
|
|
api.registerShouldShowComponent(shouldShowComponent);
|
|
expect(api.shouldShowComponent(UIComponent.CreateRooms)).toBe(true);
|
|
expect(shouldShowComponent).toHaveBeenCalledWith("UIComponent.roomCreation");
|
|
});
|
|
});
|