Fix pod log dropdown not switching
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?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
EE specific content should be in the top level /ee
folder -
For a paid feature, have we considered GitLab.com plans, how it works for groups, and is there a design for promoting it to users who aren't on the correct plan? -
Security reports checked/validated by reviewer