mirror of
https://github.com/vector-im/element-web.git
synced 2026-06-11 19:18:49 +00:00
91a3cb03c1
mkdir apps/web/scripts
mv scripts/{cleanup.sh,ci_package.sh,copy-res.ts,deploy.py,package.sh} apps/web/scripts
And a couple of gitignore tweaks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
/*
|
|
Copyright 2025 New Vector 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 React from "react";
|
|
import { render } from "jest-matrix-react";
|
|
|
|
import ConfirmKeyStorageOffDialog from "../../../../../src/components/views/dialogs/ConfirmKeyStorageOffDialog";
|
|
|
|
describe("ConfirmKeyStorageOffDialog", () => {
|
|
beforeEach(() => {
|
|
jest.resetAllMocks();
|
|
});
|
|
|
|
it("renders", () => {
|
|
const dialog = render(<ConfirmKeyStorageOffDialog onFinished={jest.fn()} />);
|
|
expect(dialog.asFragment()).toMatchSnapshot();
|
|
});
|
|
|
|
it("calls onFinished with dismissed=true if we dismiss", () => {
|
|
const onFinished = jest.fn();
|
|
const dialog = render(<ConfirmKeyStorageOffDialog onFinished={onFinished} />);
|
|
|
|
dialog.getByRole("button", { name: "Yes, dismiss" }).click();
|
|
|
|
expect(onFinished).toHaveBeenCalledWith(true);
|
|
});
|
|
|
|
it("calls onFinished with dismissed=true if we continue", () => {
|
|
const onFinished = jest.fn();
|
|
const dialog = render(<ConfirmKeyStorageOffDialog onFinished={onFinished} />);
|
|
|
|
dialog.getByRole("button", { name: "Go to Settings" }).click();
|
|
|
|
expect(onFinished).toHaveBeenCalledWith(false);
|
|
});
|
|
});
|