From d5bbe8e5b2e5f453b6a55dca366c0c5703e40b06 Mon Sep 17 00:00:00 2001 From: Tim Vahlbrock Date: Fri, 22 Nov 2024 12:17:01 +0100 Subject: [PATCH] Update PollEndBody tests --- .../views/messages/MPollEndBody-test.tsx | 8 +-- .../__snapshots__/MPollEndBody-test.tsx.snap | 49 ++++++++++++++++--- 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/test/unit-tests/components/views/messages/MPollEndBody-test.tsx b/test/unit-tests/components/views/messages/MPollEndBody-test.tsx index e3883b7033..73328333c2 100644 --- a/test/unit-tests/components/views/messages/MPollEndBody-test.tsx +++ b/test/unit-tests/components/views/messages/MPollEndBody-test.tsx @@ -6,16 +6,16 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only Please see LICENSE files in the repository root for full details. */ -import React from "react"; import { render, waitFor } from "jest-matrix-react"; -import { EventTimeline, MatrixEvent, Room, M_TEXT } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; +import { EventTimeline, M_TEXT, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import React from "react"; import { IBodyProps } from "../../../../../src/components/views/messages/IBodyProps"; import { MPollEndBody } from "../../../../../src/components/views/messages/MPollEndBody"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; -import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; import { MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; +import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; import { flushPromises, getMockClientWithEventEmitter, @@ -132,7 +132,7 @@ describe("", () => { // quick check for poll tile expect(getByTestId("pollQuestion").innerHTML).toEqual("Question?"); - expect(getByTestId("totalVotes").innerHTML).toEqual("Final result based on 0 votes"); + expect(getByTestId("totalVotes").innerHTML).toEqual("Final result based on 0 votes. Click here to see full results"); }); it("does not render a poll tile when end event is invalid", async () => { diff --git a/test/unit-tests/components/views/messages/__snapshots__/MPollEndBody-test.tsx.snap b/test/unit-tests/components/views/messages/__snapshots__/MPollEndBody-test.tsx.snap index ac2603d89d..131bfb1cd8 100644 --- a/test/unit-tests/components/views/messages/__snapshots__/MPollEndBody-test.tsx.snap +++ b/test/unit-tests/components/views/messages/__snapshots__/MPollEndBody-test.tsx.snap @@ -46,9 +46,26 @@ exports[` when poll start event exists in current timeline rende Socks
- 0 votes +
+
+
+
+
+ + 0 votes +
@@ -78,9 +95,26 @@ exports[` when poll start event exists in current timeline rende Shoes
- 0 votes +
+
+
+
+
+ + 0 votes +
@@ -96,9 +130,12 @@ exports[` when poll start event exists in current timeline rende
- Final result based on 0 votes + + Final result based on 0 votes. Click here to see full results +