Stop using deprecated js-sdk fields (#30552)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
789dba7b3d
commit
e880a866ed
@@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details.
|
||||
import EventEmitter from "events";
|
||||
import { type MethodLikeKeys, mocked, type MockedObject, type PropertyLikeKeys } from "jest-mock";
|
||||
import { Feature, ServerSupport } from "matrix-js-sdk/src/feature";
|
||||
import { type MatrixClient, type Room, MatrixError, User } from "matrix-js-sdk/src/matrix";
|
||||
import { type MatrixClient, type Room, User } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import { MatrixClientPeg } from "../../src/MatrixClientPeg";
|
||||
|
||||
@@ -138,7 +138,6 @@ export const mockClientMethodsServer = (): Partial<Record<MethodLikeKeys<MatrixC
|
||||
isVersionSupported: jest.fn().mockResolvedValue(false),
|
||||
getVersions: jest.fn().mockResolvedValue({}),
|
||||
isFallbackICEServerAllowed: jest.fn(),
|
||||
getAuthIssuer: jest.fn().mockRejectedValue(new MatrixError({ errcode: "M_UNKNOWN" }, 404)),
|
||||
});
|
||||
|
||||
export const mockClientMethodsDevice = (
|
||||
|
||||
@@ -125,8 +125,8 @@ describe("DecryptionFailureTracker", function () {
|
||||
|
||||
// use three different errors so that we can distinguish the reports
|
||||
const error1 = DecryptionFailureCode.MEGOLM_UNKNOWN_INBOUND_SESSION_ID;
|
||||
const error2 = DecryptionFailureCode.MEGOLM_BAD_ROOM;
|
||||
const error3 = DecryptionFailureCode.MEGOLM_MISSING_FIELDS;
|
||||
const error2 = DecryptionFailureCode.MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE;
|
||||
const error3 = DecryptionFailureCode.MEGOLM_KEY_WITHHELD;
|
||||
|
||||
// event that will be marked as visible before it's marked as undecryptable
|
||||
const markedVisibleFirst = await createFailedDecryptionEvent({ code: error1 });
|
||||
@@ -536,8 +536,8 @@ describe("DecryptionFailureTracker", function () {
|
||||
|
||||
// use three different errors so that we can distinguish the reports
|
||||
const error1 = DecryptionFailureCode.MEGOLM_UNKNOWN_INBOUND_SESSION_ID;
|
||||
const error2 = DecryptionFailureCode.MEGOLM_BAD_ROOM;
|
||||
const error3 = DecryptionFailureCode.MEGOLM_MISSING_FIELDS;
|
||||
const error2 = DecryptionFailureCode.MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE;
|
||||
const error3 = DecryptionFailureCode.MEGOLM_KEY_WITHHELD;
|
||||
|
||||
// event that will be slow to decrypt
|
||||
const lateDecryption = await createFailedDecryptionEvent({ code: error1 });
|
||||
@@ -638,8 +638,8 @@ describe("DecryptionFailureTracker", function () {
|
||||
|
||||
// use three different errors so that we can distinguish the reports
|
||||
const error1 = DecryptionFailureCode.MEGOLM_UNKNOWN_INBOUND_SESSION_ID;
|
||||
const error2 = DecryptionFailureCode.MEGOLM_BAD_ROOM;
|
||||
const error3 = DecryptionFailureCode.MEGOLM_MISSING_FIELDS;
|
||||
const error2 = DecryptionFailureCode.MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE;
|
||||
const error3 = DecryptionFailureCode.MEGOLM_KEY_WITHHELD;
|
||||
|
||||
// event from a federated user (@alice:example.com)
|
||||
const federatedDecryption = await createFailedDecryptionEvent({
|
||||
|
||||
@@ -112,7 +112,6 @@ describe("<UserMenu>", () => {
|
||||
|
||||
it("should render 'Link new device' button in OIDC native mode", async () => {
|
||||
sdkContext.client = stubClient();
|
||||
mocked(sdkContext.client.getAuthIssuer).mockResolvedValue({ issuer: "https://issuer/" });
|
||||
const openIdMetadata = mockOpenIdConfiguration("https://issuer/");
|
||||
openIdMetadata.grant_types_supported.push(DEVICE_CODE_SCOPE);
|
||||
fetchMock.get("https://issuer/.well-known/openid-configuration", openIdMetadata);
|
||||
|
||||
Reference in New Issue
Block a user