1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-07 21:23:00 +03:00

add fallback reply for poll start (#10380)

This commit is contained in:
Kerry
2023-03-17 10:27:56 +13:00
committed by GitHub
parent a86a8e7f8e
commit 5211b628d6
3 changed files with 28 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ import {
stripHTMLReply,
stripPlainReply,
} from "../src/utils/Reply";
import { mkEvent } from "./test-utils";
import { makePollStartEvent, mkEvent } from "./test-utils";
import { RoomPermalinkCreator } from "../src/utils/permalinks/Permalinks";
function makeTestEvent(type: string, content: IContent): MatrixEvent {
@@ -160,6 +160,12 @@ But this is not
expect(getNestedReplyText(event, mockPermalinkGenerator)).toMatchSnapshot();
});
it("should create the expected fallback text for poll start events", () => {
const event = makePollStartEvent("Will this test pass?", "@user:server.org");
expect(getNestedReplyText(event, mockPermalinkGenerator)).toMatchSnapshot();
});
});
describe("shouldDisplayReply", () => {

View File

@@ -53,3 +53,12 @@ exports[`Reply getNestedReplyText should create the expected fallback text for p
"html": "<mx-reply><blockquote><a href="$$permalink$$">In reply to</a> <a href="https://matrix.to/#/@user1:server">@user1:server</a><br>Ended poll</blockquote></mx-reply>",
}
`;
exports[`Reply getNestedReplyText should create the expected fallback text for poll start events 1`] = `
{
"body": "> <@user:server.org> started poll: Will this test pass?
",
"html": "<mx-reply><blockquote><a href="$$permalink$$">In reply to</a> <a href="https://matrix.to/#/@user:server.org">@user:server.org</a><br>Poll: Will this test pass?</blockquote></mx-reply>",
}
`;