Fix name & tests

dbkr/key_backup_by_default
David Baker 2024-10-22 15:36:04 +01:00
parent 2c7247713a
commit 7f10cd6a9e
3 changed files with 11 additions and 11 deletions

View File

@ -11,7 +11,7 @@ import { MatrixClient } from "matrix-js-sdk/src/matrix";
import AuthPage from "../../views/auth/AuthPage";
import CompleteSecurityBody from "../../views/auth/CompleteSecurityBody";
import InitialCryptoSetup from "../../views/dialogs/security/InitialCryptoSetup";
import InitialCryptoSetupDialog from "../../views/dialogs/security/InitialCryptoSetup";
interface IProps {
matrixClient: MatrixClient;
@ -25,7 +25,7 @@ export default class E2eSetup extends React.Component<IProps> {
return (
<AuthPage>
<CompleteSecurityBody>
<InitialCryptoSetup
<InitialCryptoSetupDialog
matrixClient={this.props.matrixClient}
onFinished={this.props.onFinished}
accountPassword={this.props.accountPassword}

View File

@ -29,7 +29,7 @@ interface Props {
* up message key backup. In most cases, only a spinner is shown, but for more
* complex auth like SSO, the user may need to complete some steps to proceed.
*/
const InitialCryptoSetup: React.FC<Props> = ({ matrixClient, accountPassword, tokenLogin, onFinished }) => {
const InitialCryptoSetupDialog: React.FC<Props> = ({ matrixClient, accountPassword, tokenLogin, onFinished }) => {
const [error, setError] = useState(false);
const doSetup = useCallback(async () => {
@ -102,4 +102,4 @@ const InitialCryptoSetup: React.FC<Props> = ({ matrixClient, accountPassword, to
);
};
export default InitialCryptoSetup;
export default InitialCryptoSetupDialog;

View File

@ -12,14 +12,14 @@ import { mocked } from "jest-mock";
import { MatrixClient } from "matrix-js-sdk/src/matrix";
import { createCrossSigning } from "../../../../../src/CreateCrossSigning";
import CreateCrossSigningDialog from "../../../../../src/components/views/dialogs/security/CreateCrossSigningDialog";
import InitialCryptoSetupDialog from "../../../../../src/components/views/dialogs/security/InitialCryptoSetupDialog";
import { createTestClient } from "../../../../test-utils";
jest.mock("../../../../../src/CreateCrossSigning", () => ({
createCrossSigning: jest.fn(),
}));
describe("CreateCrossSigningDialog", () => {
describe("InitialCryptoSetupDialog", () => {
let client: MatrixClient;
let createCrossSigningResolve: () => void;
let createCrossSigningReject: (e: Error) => void;
@ -43,7 +43,7 @@ describe("CreateCrossSigningDialog", () => {
const onFinished = jest.fn();
render(
<CreateCrossSigningDialog
<InitialCryptoSetupDialog
matrixClient={client}
accountPassword="hunter2"
tokenLogin={false}
@ -61,7 +61,7 @@ describe("CreateCrossSigningDialog", () => {
it("should display an error if createCrossSigning fails", async () => {
render(
<CreateCrossSigningDialog
<InitialCryptoSetupDialog
matrixClient={client}
accountPassword="hunter2"
tokenLogin={false}
@ -78,7 +78,7 @@ describe("CreateCrossSigningDialog", () => {
const onFinished = jest.fn();
render(
<CreateCrossSigningDialog
<InitialCryptoSetupDialog
matrixClient={client}
accountPassword="hunter2"
tokenLogin={true}
@ -95,7 +95,7 @@ describe("CreateCrossSigningDialog", () => {
const onFinished = jest.fn();
render(
<CreateCrossSigningDialog
<InitialCryptoSetupDialog
matrixClient={client}
accountPassword="hunter2"
tokenLogin={false}
@ -113,7 +113,7 @@ describe("CreateCrossSigningDialog", () => {
it("should retry when the retry button is clicked", async () => {
render(
<CreateCrossSigningDialog
<InitialCryptoSetupDialog
matrixClient={client}
accountPassword="hunter2"
tokenLogin={false}