mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-11-04 08:10:18 +08:00
Compare commits
3 Commits
stable/202
...
beta/20240
| Author | SHA1 | Date | |
|---|---|---|---|
| 61163037d4 | |||
| 3577982a93 | |||
| 3ad0b92dcd |
2
daemon
2
daemon
Submodule daemon updated: c9f251d797...2e49d649d7
@ -145,6 +145,16 @@ ApplicationWindow {
|
||||
LRCInstance.selectConversation(convUid);
|
||||
}
|
||||
}
|
||||
ListElement {
|
||||
label: "Account ID"
|
||||
type: "combobox"
|
||||
getDataModel: () => AccountListModel
|
||||
displayRole: AccountList.Username
|
||||
onIndexChanged: function(model, index) {
|
||||
const accountId = JamiQmlUtils.getModelData(model, index, AccountList.ID);
|
||||
LRCInstance.currentAccountId = accountId;
|
||||
}
|
||||
}
|
||||
ListElement {
|
||||
label: "Force local preview"
|
||||
type: "checkbox"
|
||||
|
||||
@ -24,15 +24,17 @@ class PreviewEngineFixture : public ::testing::Test
|
||||
public:
|
||||
// Prepare unit test context. Called at
|
||||
// prior each unit test execution
|
||||
void SetUp() override {
|
||||
void SetUp() override
|
||||
{
|
||||
server = new QHttpServer();
|
||||
// Setup a server that can return an HTML body.
|
||||
server->listen(QHostAddress::LocalHost, 8000);
|
||||
}
|
||||
|
||||
// Close unit test context. Called
|
||||
// after each unit test ending
|
||||
void TearDown() override {
|
||||
// Close unit test context. Called
|
||||
// after each unit test ending
|
||||
void TearDown() override
|
||||
{
|
||||
delete server;
|
||||
}
|
||||
|
||||
@ -47,9 +49,8 @@ public:
|
||||
TEST_F(PreviewEngineFixture, ParsingALinkEmitsInfoReadySignal)
|
||||
{
|
||||
auto link = QString("http://localhost:8000/test");
|
||||
server->route("/test", [] () {
|
||||
return QString("<meta property=\"og:title\" content=\"Test title\">");
|
||||
});
|
||||
server->route("/test",
|
||||
[]() { return QString("<meta property=\"og:title\" content=\"Test title\">"); });
|
||||
|
||||
QSignalSpy infoReadySpy(globalEnv.previewEngine.data(), &PreviewEngine::infoReady);
|
||||
|
||||
@ -70,14 +71,14 @@ TEST_F(PreviewEngineFixture, ParsingALinkEmitsInfoReadySignal)
|
||||
*/
|
||||
TEST_F(PreviewEngineFixture, UTF8CharactersAreParsedCorrectly)
|
||||
{
|
||||
auto link = QString("http://localhost:8000/test");
|
||||
server->route("/test", [] () {
|
||||
return QString("<meta property=\"og:description\" content=\"Test de caractères Utf-8");
|
||||
const auto testString = QString("liberté 自由 自由 свобода Szabadság ŐőŰű 자유 😊 € è ñ");
|
||||
server->route("/test", [&]() {
|
||||
return QString("<meta property=\"og:description\" content=\"%1\">").arg(testString);
|
||||
});
|
||||
|
||||
QSignalSpy infoReadySpy(globalEnv.previewEngine.data(), &PreviewEngine::infoReady);
|
||||
|
||||
Q_EMIT globalEnv.previewEngine->parseLink("msgId_01", link);
|
||||
Q_EMIT globalEnv.previewEngine->parseLink("msgId_01", "http://localhost:8000/test");
|
||||
|
||||
// Wait for the infoReady signal which should be emitted once.
|
||||
infoReadySpy.wait();
|
||||
@ -89,5 +90,5 @@ TEST_F(PreviewEngineFixture, UTF8CharactersAreParsedCorrectly)
|
||||
// Check that the description is parsed correctly.
|
||||
QVariantMap info = infoReadyArguments.at(1).toMap();
|
||||
EXPECT_TRUE(info.contains("description"));
|
||||
EXPECT_EQ(info["description"].toString(), "Test de caractères Utf-8");
|
||||
EXPECT_EQ(info["description"].toString(), testString);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user