From 552f4e8f1339d6630fd9c0cd8d62d39fca7f1a9c Mon Sep 17 00:00:00 2001 From: James Graham Date: Mon, 10 Apr 2023 12:55:31 +0000 Subject: [PATCH] Fix Rich Emote Test Windows Qt5 Make sure that the receiveRichEmote test grabs an actual colour for the user as it can vary by platform. --- autotests/texthandlertest.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autotests/texthandlertest.cpp b/autotests/texthandlertest.cpp index 469a7bcb8..a7de31615 100644 --- a/autotests/texthandlertest.cpp +++ b/autotests/texthandlertest.cpp @@ -552,14 +552,16 @@ void TextHandlerTest::receiveRichPlainUrl() // N.B. The second message in the test timeline is marked as an emote. void TextHandlerTest::receiveRichEmote() { + auto event = room->messageEvents().at(1).get(); + auto author = static_cast(room->user(event->senderId())); const QString testInputString = QStringLiteral("This is an emote."); - const QString testOutputString = - QStringLiteral("* @example:example.org This is an emote."); + const QString testOutputString = QStringLiteral("* color().name() + + QStringLiteral("\">@example:example.org This is an emote."); TextHandler testTextHandler; testTextHandler.setData(testInputString); - QCOMPARE(testTextHandler.handleRecieveRichText(Qt::RichText, room, room->messageEvents().at(1).get()), testOutputString); + QCOMPARE(testTextHandler.handleRecieveRichText(Qt::RichText, room, event), testOutputString); } void TextHandlerTest::receiveRichEdited_data()