mirror of https://github.com/vector-im/riot-web
Fix Read Receipt Test (#28719)
* Update test snapshot as the date formatting appears to have gained a comma, and somehow got through the merge tests on the dependency bump. * Actually this was the problempull/28723/head
parent
ba98c2085d
commit
cf3bdbdc7a
|
@ -10,6 +10,7 @@ import React, { ComponentProps } from "react";
|
|||
import { render, screen, waitFor } from "jest-matrix-react";
|
||||
import { RoomMember } from "matrix-js-sdk/src/matrix";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { mocked } from "jest-mock";
|
||||
|
||||
import {
|
||||
determineAvatarPosition,
|
||||
|
@ -20,6 +21,9 @@ import * as languageHandler from "../../../../../src/languageHandler";
|
|||
import { stubClient } from "../../../../test-utils";
|
||||
import dispatcher from "../../../../../src/dispatcher/dispatcher";
|
||||
import { Action } from "../../../../../src/dispatcher/actions";
|
||||
import { formatDate } from "../../../../../src/DateUtils";
|
||||
|
||||
jest.mock("../../../../../src/DateUtils");
|
||||
|
||||
describe("ReadReceiptGroup", () => {
|
||||
describe("TooltipText", () => {
|
||||
|
@ -87,6 +91,10 @@ describe("ReadReceiptGroup", () => {
|
|||
describe("<ReadReceiptPerson />", () => {
|
||||
stubClient();
|
||||
|
||||
// We pick a fixed time but this can still vary depending on the locale
|
||||
// the tests are run in. We are not testing date formatting here, so stub it out.
|
||||
mocked(formatDate).mockReturnValue("==MOCK FORMATTED DATE==");
|
||||
|
||||
const ROOM_ID = "roomId";
|
||||
const USER_ID = "@alice:example.org";
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ exports[`ReadReceiptGroup <ReadReceiptPerson /> should render 1`] = `
|
|||
<p
|
||||
class="mx_ReadReceiptGroup_secondary"
|
||||
>
|
||||
Wed, 15 May, 0:00
|
||||
==MOCK FORMATTED DATE==
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue