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

@ -32,13 +32,6 @@ import { TILE_SERVER_WK_KEY } from "../../../../src/utils/WellKnownUtils";
import { makeLocationEvent } from "../../../test-utils/location";
import { getMockClientWithEventEmitter } from "../../../test-utils";
// Fake random strings to give a predictable snapshot
jest.mock("matrix-js-sdk/src/randomstring", () => {
return {
randomString: () => "abdefghi",
};
});
describe("MLocationBody", () => {
const mapOptions = { container: {} as unknown as HTMLElement, style: "" };
describe("<MLocationBody>", () => {

View file

@ -34,17 +34,17 @@ exports[`MLocationBody <MLocationBody> without error renders map correctly 1`] =
class="mx_MLocationBody"
>
<div
aria-describedby="mx_TooltipTarget_abdefghi"
aria-describedby="mx_TooltipTarget_9K38QgU2"
tabindex="0"
>
<div
class="mx_Map mx_MLocationBody_map"
id="mx_Map_mx_MLocationBody_$2_abdefghi"
id="mx_Map_mx_MLocationBody_$2_vY7Q4uEh"
>
<span>
<div
class="mx_Marker mx_Marker_defaultColor"
id="mx_MLocationBody_$2_abdefghi-marker"
id="mx_MLocationBody_$2_vY7Q4uEh-marker"
>
<div
class="mx_Marker_border"
@ -67,17 +67,17 @@ exports[`MLocationBody <MLocationBody> without error renders marker correctly fo
class="mx_MLocationBody"
>
<div
aria-describedby="mx_TooltipTarget_abdefghi"
aria-describedby="mx_TooltipTarget_9K38QgU2"
tabindex="0"
>
<div
class="mx_Map mx_MLocationBody_map"
id="mx_Map_mx_MLocationBody_$3_abdefghi"
id="mx_Map_mx_MLocationBody_$3_vY7Q4uEh"
>
<span>
<div
class="mx_Marker mx_Marker_defaultColor"
id="mx_MLocationBody_$3_abdefghi-marker"
id="mx_MLocationBody_$3_vY7Q4uEh-marker"
>
<div
class="mx_Marker_border"