Improve randomString mock for better snapshots (#11375)
This commit is contained in:
@@ -23,13 +23,6 @@ import ManageRestrictedJoinRuleDialog from "../../../../src/components/views/dia
|
||||
import SpaceStore from "../../../../src/stores/spaces/SpaceStore";
|
||||
import DMRoomMap from "../../../../src/utils/DMRoomMap";
|
||||
|
||||
// Fake random strings to give a predictable snapshot
|
||||
jest.mock("matrix-js-sdk/src/randomstring", () => {
|
||||
return {
|
||||
randomString: () => "abdefghi",
|
||||
};
|
||||
});
|
||||
|
||||
describe("<ManageRestrictedJoinRuleDialog />", () => {
|
||||
const userId = "@alice:server.org";
|
||||
const mockClient = getMockClientWithEventEmitter({
|
||||
|
||||
@@ -23,11 +23,6 @@ import SdkConfig from "../../../../src/SdkConfig";
|
||||
import { flushPromises } from "../../../test-utils";
|
||||
import { ValidatedServerConfig } from "../../../../src/utils/ValidatedServerConfig";
|
||||
|
||||
// Fake random strings to give a predictable snapshot for IDs
|
||||
jest.mock("matrix-js-sdk/src/randomstring", () => ({
|
||||
randomString: () => "abdefghi",
|
||||
}));
|
||||
|
||||
describe("<ServerPickerDialog />", () => {
|
||||
const defaultServerConfig = {
|
||||
hsUrl: "https://matrix.org",
|
||||
|
||||
+2
-2
@@ -107,11 +107,11 @@ exports[`<ManageRestrictedJoinRuleDialog /> should list spaces which are not par
|
||||
class="mx_Checkbox mx_Checkbox_hasKind mx_Checkbox_kind_solid"
|
||||
>
|
||||
<input
|
||||
id="checkbox_abdefghi"
|
||||
id="checkbox_vY7Q4uEh9K"
|
||||
type="checkbox"
|
||||
/>
|
||||
<label
|
||||
for="checkbox_abdefghi"
|
||||
for="checkbox_vY7Q4uEh9K"
|
||||
>
|
||||
<div
|
||||
class="mx_Checkbox_background"
|
||||
|
||||
@@ -56,7 +56,7 @@ exports[`<ServerPickerDialog /> should render dialog 1`] = `
|
||||
class="mx_StyledRadioButton_content"
|
||||
>
|
||||
<div
|
||||
aria-describedby="mx_TooltipTarget_abdefghi"
|
||||
aria-describedby="mx_TooltipTarget_vY7Q4uEh"
|
||||
class="mx_TextWithTooltip_target mx_Login_underlinedServerName"
|
||||
tabindex="0"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user