mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-24 18:59:17 +00:00
Align common_* strings with Element X project in Localazy (#11434)
This commit is contained in:
committed by
GitHub
parent
1a49a38f04
commit
c40141cc4f
@@ -22,15 +22,36 @@ import React from "react";
|
||||
import AddExistingToSpaceDialog from "../../../../src/components/views/dialogs/AddExistingToSpaceDialog";
|
||||
import SettingsStore from "../../../../src/settings/SettingsStore";
|
||||
import DMRoomMap from "../../../../src/utils/DMRoomMap";
|
||||
import { mkSpace, stubClient } from "../../../test-utils";
|
||||
import { mkRoom, mkSpace, stubClient } from "../../../test-utils";
|
||||
|
||||
describe("<AddExistingToSpaceDialog />", () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(Element.prototype, "clientHeight", "get").mockReturnValue(600);
|
||||
});
|
||||
|
||||
it("looks as expected", () => {
|
||||
const client = stubClient();
|
||||
const dialog = renderAddExistingToSpaceDialog(client);
|
||||
expect(dialog.asFragment()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("should show 'no results' if appropriate", () => {
|
||||
const client = stubClient();
|
||||
const { getByText } = renderAddExistingToSpaceDialog(client);
|
||||
expect(getByText("No results")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("should not show 'no results' if we have results to show", () => {
|
||||
const client = stubClient();
|
||||
mocked(client.getVisibleRooms).mockReturnValue([
|
||||
mkSpace(client, "!space2:example.com"),
|
||||
mkRoom(client, "!room2:example.com"),
|
||||
]);
|
||||
const { queryByText, getByText } = renderAddExistingToSpaceDialog(client);
|
||||
expect(queryByText("No results")).not.toBeInTheDocument();
|
||||
expect(getByText("!room2:example.com")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
describe("If the feature_dynamic_room_predecessors is not enabled", () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(SettingsStore, "getValue").mockReturnValue(false);
|
||||
|
||||
@@ -44,6 +44,11 @@ describe("QuickSettingsButton", () => {
|
||||
expect(getQuickSettingsButton()).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("should render the quick settings button in expanded mode", () => {
|
||||
const { asFragment } = render(<QuickSettingsButton isPanelCollapsed={false} />);
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when the quick settings are open", () => {
|
||||
beforeEach(async () => {
|
||||
renderQuickSettingsButton();
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`QuickSettingsButton should render the quick settings button in expanded mode 1`] = `
|
||||
<DocumentFragment>
|
||||
<div
|
||||
aria-expanded="true"
|
||||
aria-label="Quick settings"
|
||||
class="mx_AccessibleButton mx_QuickSettingsButton expanded"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Settings
|
||||
</div>
|
||||
</DocumentFragment>
|
||||
`;
|
||||
Reference in New Issue
Block a user