test(ui): adapt SWR contract tests to the cached-resource layer — 692/692
Demo images / Build & push demo images (push) Failing after 2m9s

The keeps-data-visible-while-refreshing tests for PeerFiles, Server, and
LightningChannels mounted without Pinia (the converted components now
pull the resources store in setup) — add createPinia to the mounts.
LightningChannelsPanel: refresh the main channel list before the closed
history so the primary entry gets the first response, and null-guard
both fetchers' response shapes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
archipelago
2026-07-28 05:55:12 -04:00
co-authored by Claude Fable 5
parent ea254f63af
commit 8fd72b947a
3 changed files with 12 additions and 5 deletions
@@ -474,9 +474,9 @@ const channelsRes = useCachedResource<ChannelsData>({
method: 'lnd.listchannels', timeout: 15000, signal, dedup: true, maxRetries: 1,
})
return {
channels: result.channels || [],
total_inbound: result.total_inbound || 0,
total_outbound: result.total_outbound || 0,
channels: result?.channels || [],
total_inbound: result?.total_inbound || 0,
total_outbound: result?.total_outbound || 0,
}
},
})
@@ -486,7 +486,7 @@ const closedRes = useCachedResource<ClosedChannel[]>({
const closed = await rpcClient.call<{ channels: ClosedChannel[] }>({
method: 'lnd.closedchannels', timeout: 15000, signal, dedup: true, maxRetries: 1,
})
return closed.channels || []
return closed?.channels || []
},
})
const loading = computed(() =>
@@ -570,8 +570,9 @@ function capacityPercent(amount: number, capacity: number): number {
}
function loadChannels(): Promise<void> {
const main = channelsRes.refresh()
void closedRes.refresh()
return channelsRes.refresh()
return main
}
function feeParams(): { target_conf?: number; sat_per_vbyte?: number } | null {