fix(cockpit/activities tree): reflect selection of diagram in tree

This commit also add a test and (partially) rewrites the cockpit tests

Closes: CAM-1946