Use LegacyRendezvousFailureReason over RendezvousFailureReason (#12578)

This commit is contained in:
Michael Telatynski 2024-06-06 09:19:49 +01:00 committed by GitHub
parent e867196c15
commit ca7760789b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 18 deletions

View file

@ -17,7 +17,7 @@ limitations under the License.
import { cleanup, render, waitFor } from "@testing-library/react";
import { MockedObject, mocked } from "jest-mock";
import React from "react";
import { MSC3906Rendezvous, RendezvousFailureReason } from "matrix-js-sdk/src/rendezvous";
import { MSC3906Rendezvous, LegacyRendezvousFailureReason } from "matrix-js-sdk/src/rendezvous";
import { HTTPError, LoginTokenPostResponse } from "matrix-js-sdk/src/matrix";
import LoginWithQR from "../../../../../src/components/views/auth/LoginWithQR";
@ -111,7 +111,7 @@ describe("<LoginWithQR />", () => {
await waitFor(() =>
expect(mockedFlow).toHaveBeenLastCalledWith({
phase: Phase.Error,
failureReason: RendezvousFailureReason.HomeserverLacksSupport,
failureReason: LegacyRendezvousFailureReason.HomeserverLacksSupport,
onClick: expect.any(Function),
}),
);
@ -125,7 +125,7 @@ describe("<LoginWithQR />", () => {
await waitFor(() =>
expect(mockedFlow).toHaveBeenLastCalledWith({
phase: Phase.Error,
failureReason: RendezvousFailureReason.Unknown,
failureReason: LegacyRendezvousFailureReason.Unknown,
onClick: expect.any(Function),
}),
);
@ -160,7 +160,7 @@ describe("<LoginWithQR />", () => {
const onClick = mockedFlow.mock.calls[0][0].onClick;
await onClick(Click.Cancel);
expect(onFinished).toHaveBeenCalledWith(false);
expect(rendezvous.cancel).toHaveBeenCalledWith(RendezvousFailureReason.UserCancelled);
expect(rendezvous.cancel).toHaveBeenCalledWith(LegacyRendezvousFailureReason.UserCancelled);
// try again
onClick(Click.TryAgain);
@ -205,7 +205,7 @@ describe("<LoginWithQR />", () => {
const onClick = mockedFlow.mock.calls[0][0].onClick;
await onClick(Click.Back);
expect(onFinished).toHaveBeenCalledWith(false);
expect(rendezvous.cancel).toHaveBeenCalledWith(RendezvousFailureReason.UserCancelled);
expect(rendezvous.cancel).toHaveBeenCalledWith(LegacyRendezvousFailureReason.UserCancelled);
});
test("render QR then decline", async () => {