Files
ThreadNet-Web/test/unit-tests/toasts/SetupEncryptionToast-test.tsx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
987 B
TypeScript
Raw Normal View History

2024-12-17 14:50:48 +00:00
/*
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
2024-12-17 14:50:48 +00:00
Please see LICENSE files in the repository root for full details.
*/
import React from "react";
import { render, screen } from "jest-matrix-react";
import ToastContainer from "../../../src/components/structures/ToastContainer";
import { Kind, showToast } from "../../../src/toasts/SetupEncryptionToast";
describe("SetupEncryptionToast", () => {
beforeEach(() => {
render(<ToastContainer />);
});
it("should render the 'set up recovery' toast", async () => {
2024-12-17 14:50:48 +00:00
showToast(Kind.SET_UP_RECOVERY);
await expect(screen.findByText("Set up recovery")).resolves.toBeInTheDocument();
});
it("should render the 'key storage out of sync' toast", async () => {
showToast(Kind.KEY_STORAGE_OUT_OF_SYNC);
await expect(screen.findByText("Your key storage is out of sync.")).resolves.toBeInTheDocument();
});
2024-12-17 14:50:48 +00:00
});