thomasnordquist / MQTT-Explorer

An all-round MQTT client that provides a structured topic overview
https://mqtt-explorer.com
Other
2.86k stars 282 forks source link

ui-test: Expand topic does not handle non unique topics #796

Open bj00rn opened 1 month ago

bj00rn commented 1 month ago

expandTopic logic is broken, it does not work for nodes that share the same name on different levels.

I had to change the logic since playwright is prevented from expanding hidden nodes by accessibility. I.e to expand lamp of topic livingroom/lamps/lamp, livingroom->lamps->lamp must be expanded in sequence.

the current logic will not work when you have multiple topics with lamp in the path

livingroom/lamps/lamp kitchen/lamps/lamp

https://github.com/thomasnordquist/MQTT-Explorer/blob/c88978f0ddb529eb83ccfd36c3aee8a8704877b6/src/spec/util/expandTopic.ts#L36