Skip to content

Fix pod log dropdown not switching

Jose Ivan Vargas requested to merge jivl-fix-kubernetes-pod-dropdown into master

What does this MR do?

Fixes the pod dropdown not switching logs when clicking the different pods in the dropdown

This was a regression caused, when the dropdown feature was introduced here: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6111

It seems that during testing and reviews there was a small slip where adding a click listener for an li element was used instead of the intended button one. Although there was a test that was meant to catch that particular type of scenario, that said test had an incorrect assertion.

How was this assertion incorrect? The assertion made use of a spy, which has some assertion helpers, such as toHaveBeenCalled and calls.count(), the former will be truthy if the spy was called at least once, but in this particular test scenario the test was meant to have a least a count of 2 calls for a particular method.

The takeaway from this regression, from a developer point of view, always make sure that when asserting if spy was called or not, make sure that the proper number of calls are being compared in your tests, this could help catching regressions that could slip reviews.

What are the relevant issue numbers?

closes #7745 (closed)

Does this MR meet the acceptance criteria?

Edited by Jose Ivan Vargas

Merge request reports

Loading