mirror of
https://github.com/logos-blockchain/logos-blockchain-ui.git
synced 2026-05-17 15:29:29 +00:00
BlockchainBackend's constructor called LogosAPIClient::requestObject()
for liblogos_blockchain_module while running inside initLogos(). ui-host
invokes initLogos() synchronously (Qt::DirectConnection) and only
signals READY after it returns, but requestObject() blocks for its full
20s timeout when the backend node module isn't running yet — the normal
case, since the node is started from this UI. ui-host therefore missed
its readiness deadline, the host killed the process, and the whole view
failed to load ("Failed to load UI plugin").
Defer the newBlock subscription to subscribeToBlockEvents(), invoked
after a successful startBlockchain(), so initLogos() returns immediately
and the QML view loads whether or not the node is running yet. Also stop
forcing ErrorSubscribeFailed at construction.
Add tests/ui-tests.mjs: a hermetic integration test
(nix build .#integration-test) that loads the module in
logos-standalone-app and asserts the config view renders, guarding
against this regression.
https://claude.ai/code/session_01LJrxZLLrdQZXakNMCEyExE
36 lines
1.4 KiB
JavaScript
36 lines
1.4 KiB
JavaScript
import { resolve } from "node:path";
|
|
|
|
// CI sets LOGOS_QT_MCP automatically; for interactive use:
|
|
// nix build .#test-framework -o result-mcp
|
|
const root =
|
|
process.env.LOGOS_QT_MCP ||
|
|
new URL("../result-mcp", import.meta.url).pathname;
|
|
const { test, run } = await import(resolve(root, "test-framework/framework.mjs"));
|
|
|
|
// Smoke test: the blockchain UI module must load in the host
|
|
// (logos-standalone-app / logos-basecamp), connect to its process-isolated
|
|
// C++ backend over Qt Remote Objects, and render the QML view — even when the
|
|
// backend node module is not running yet (the node is started from this UI).
|
|
test("blockchain_ui: backend connects and config view renders", async (app) => {
|
|
await app.waitFor(
|
|
async () => {
|
|
// Once the BlockchainBackend replica is Valid, the loading state is
|
|
// replaced by the ConfigChoiceView. This static label proves the QML
|
|
// (including the Logos.Theme / Logos.Controls design-system imports)
|
|
// loaded and the backend replica connected.
|
|
await app.expectTexts(["Choose how to set up your node config"]);
|
|
},
|
|
{
|
|
timeout: 30000,
|
|
interval: 1000,
|
|
description: "blockchain UI to load and backend to connect",
|
|
}
|
|
);
|
|
});
|
|
|
|
test("blockchain_ui: config setup actions are visible", async (app) => {
|
|
await app.expectTexts(["Generate config", "Set path to config"]);
|
|
});
|
|
|
|
run();
|