Gracefully handle rate limit response when attempting to Sign in with QR (#11809)
* Gracefully hand rate limit response when attempting to Sign in with QR * Don't cancel after rate limit * Update src/components/views/auth/LoginWithQR.tsx Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * Add missing import * Fix mock of error --------- Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
6187c8c884
commit
54b71140b8
6 changed files with 131 additions and 18 deletions
|
@ -19,7 +19,12 @@ import React from "react";
|
|||
import { RendezvousFailureReason } from "matrix-js-sdk/src/rendezvous";
|
||||
|
||||
import LoginWithQRFlow from "../../../../../src/components/views/auth/LoginWithQRFlow";
|
||||
import { Click, Phase } from "../../../../../src/components/views/auth/LoginWithQR";
|
||||
import {
|
||||
Click,
|
||||
Phase,
|
||||
LoginWithQRFailureReason,
|
||||
FailureReason,
|
||||
} from "../../../../../src/components/views/auth/LoginWithQR";
|
||||
|
||||
describe("<LoginWithQRFlow />", () => {
|
||||
const onClick = jest.fn();
|
||||
|
@ -31,7 +36,7 @@ describe("<LoginWithQRFlow />", () => {
|
|||
const getComponent = (props: {
|
||||
phase: Phase;
|
||||
onClick?: () => Promise<void>;
|
||||
failureReason?: RendezvousFailureReason;
|
||||
failureReason?: FailureReason;
|
||||
code?: string;
|
||||
confirmationDigits?: string;
|
||||
}) => <LoginWithQRFlow {...defaultProps} {...props} />;
|
||||
|
@ -97,7 +102,10 @@ describe("<LoginWithQRFlow />", () => {
|
|||
});
|
||||
|
||||
describe("errors", () => {
|
||||
for (const failureReason of Object.values(RendezvousFailureReason)) {
|
||||
for (const failureReason of [
|
||||
...Object.values(RendezvousFailureReason),
|
||||
...Object.values(LoginWithQRFailureReason),
|
||||
]) {
|
||||
it(`renders ${failureReason}`, async () => {
|
||||
const { container } = render(
|
||||
getComponent({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue