Improve randomString mock for better snapshots (#11375)

This commit is contained in:
Michael Telatynski 2023-08-09 09:39:48 +01:00 committed by GitHub
parent c3574c2050
commit 57a0d99dc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 133 additions and 256 deletions

View file

@ -21,11 +21,6 @@ import ShareLatestLocation from "../../../../src/components/views/beacon/ShareLa
import { copyPlaintext } from "../../../../src/utils/strings";
import { flushPromises } from "../../../test-utils";
// Fake random strings to give a predictable snapshot for IDs
jest.mock("matrix-js-sdk/src/randomstring", () => ({
randomString: () => "abdefghi",
}));
jest.mock("../../../../src/utils/strings", () => ({
copyPlaintext: jest.fn().mockResolvedValue(undefined),
}));