added local updater, minor fixes
tests / package-smoke-linux (push) Skipped
tests / package-smoke-windows (push) Skipped
tests / package-smoke-macos (push) Skipped
tests / macos (push) Successful in 1m24s
tests / windows (pull_request) Skipped
tests / macos (pull_request) Skipped
tests / package-smoke-linux (pull_request) Skipped
tests / package-smoke-windows (pull_request) Skipped
tests / package-smoke-macos (pull_request) Skipped
tests / linux (push) Failing after 1m37s
tests / linux (pull_request) Failing after 1m39s
tests / windows (push) Canceled after 0s
tests / package-smoke-linux (push) Skipped
tests / package-smoke-windows (push) Skipped
tests / package-smoke-macos (push) Skipped
tests / macos (push) Successful in 1m24s
tests / windows (pull_request) Skipped
tests / macos (pull_request) Skipped
tests / package-smoke-linux (pull_request) Skipped
tests / package-smoke-windows (pull_request) Skipped
tests / package-smoke-macos (pull_request) Skipped
tests / linux (push) Failing after 1m37s
tests / linux (pull_request) Failing after 1m39s
tests / windows (push) Canceled after 0s
Signed-off-by: galeon <dertiellis@gmail.com>
This commit is contained in:
1 parent
98344a1870
commit
d4a17a4561
10 files changed
+777
-31
No files matched your search
@@ -8,9 +8,11 @@
|
||||
#include "fixtures.h"
|
||||
|
||||
#include "launcherpaths.h"
|
||||
#include "launcherversion.h"
|
||||
#include "localization.h"
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QJSValue>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQuickStyle>
|
||||
#include <QQuickWindow>
|
||||
@@ -66,6 +68,19 @@ private slots:
|
||||
// Один движок на весь тест, как в приложении: Localization держит указатель
|
||||
// на JS-движок, создавший синглтон, и второй QQmlApplicationEngine после
|
||||
// уничтожения первого оставил бы его висячим.
|
||||
const QString releasesUrl = QStringLiteral(
|
||||
"https://projects-live.galeonworx.com/api/v1/repos/galeon/BiLauncher/releases");
|
||||
const bool candidate = QStringLiteral(LAUNCHER_CHANNEL) == "rc";
|
||||
const auto release = candidate
|
||||
? R"([{"tag_name":"v1.0.0-rc1","prerelease":true,"published_at":"2026-10-14T10:52:02Z"}])"
|
||||
: R"([{"tag_name":"v1.0.0","prerelease":false,"published_at":"2026-10-14T10:52:02Z"}])";
|
||||
m_net.route(releasesUrl, [candidate, release](const FakeRequest &request) {
|
||||
const auto query = request.queryItems();
|
||||
if (query.queryItemValue("pre-release") != (candidate ? "true" : "false"))
|
||||
return FakeResponse::error(400);
|
||||
return FakeResponse::json(query.queryItemValue("page") == "1" ? release : "[]");
|
||||
});
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
QStringList warnings;
|
||||
connect(&engine, &QQmlEngine::warnings, this, [&](const QList<QQmlError> &list) {
|
||||
@@ -83,6 +98,19 @@ private slots:
|
||||
QVERIFY2(warnings.isEmpty(), qPrintable(warnings.join(u'\n')));
|
||||
QVERIFY2(g_problems.isEmpty(), qPrintable(g_problems.join(u'\n')));
|
||||
|
||||
auto *versions = window->findChild<QObject *>(QStringLiteral("launcherVersions"));
|
||||
QVERIFY(versions);
|
||||
QVERIFY(QMetaObject::invokeMethod(versions, "open"));
|
||||
QTRY_COMPARE(versions->property("state").toString(), QStringLiteral("ready"));
|
||||
const auto entriesProperty = versions->property("entries");
|
||||
const auto entries = entriesProperty.metaType() == QMetaType::fromType<QJSValue>()
|
||||
? entriesProperty.value<QJSValue>().toVariant().toList()
|
||||
: entriesProperty.toList();
|
||||
QCOMPARE(entries.size(), 1);
|
||||
QCOMPARE(entries.first().toMap().value("version").toString(),
|
||||
candidate ? QStringLiteral("1.0.0-rc1") : QStringLiteral("1.0.0"));
|
||||
QVERIFY(QMetaObject::invokeMethod(versions, "close"));
|
||||
|
||||
// Смена языка на лету перестраивает Loc.t — биндинги не должны ломаться.
|
||||
const QString titleEn = window->title();
|
||||
Localization::instance().setLanguage(QStringLiteral("ru"));
|
||||
|
||||
Reference in new issue
Block a user