Fix expandTopic selector, restore and streamline comprehensive UI tests (#938)

This commit is contained in:
Copilot
2025-12-20 23:26:15 +01:00
committed by GitHub
parent c55c3a8245
commit e725b1d012
8 changed files with 635 additions and 117 deletions

View File

@@ -22,7 +22,7 @@ export interface MockSparkplugClient {
stop: () => void
}
let sample = (function () {
const sample = (function () {
let config = {
serverUrl: 'tcp://127.0.0.1:1883',
username: '',
@@ -169,12 +169,12 @@ let sample = (function () {
// Create node command handler
// spell-checker: disable-next-line
sparkplugClient.on('ncmd', function (payload: UPayload) {
let timestamp = payload.timestamp,
const timestamp = payload.timestamp,
metrics = payload.metrics
if (metrics !== undefined && metrics !== null) {
for (let i = 0; i < metrics.length; i++) {
let metric = metrics[i]
const metric = metrics[i]
if (metric.name == 'Node Control/Rebirth' && metric.value) {
console.log("Received 'Rebirth' command")
// Publish Node BIRTH certificate
@@ -200,7 +200,7 @@ let sample = (function () {
// Loop over the metrics and store them in a map
if (metrics !== undefined && metrics !== null) {
for (let i = 0; i < metrics.length; i++) {
let metric = metrics[i]
const metric = metrics[i]
if (metric.name !== undefined && metric.name !== null) {
inboundMetricMap[metric.name] = metric.value
}