Fix issue when empty plans sorting to of terraform reports widget in MRs

Fix issue when empty plans sorting to of terraform reports widget in MRs

The intention of !183300 (merged) was that these are sorted to the bottom, but I misunderstood the behaviour of Number(''). It produces 0, not NaN. Additionally, it works that that 0 counts as false for the purposes of (0 || MAX_VALUE) which is obvious in retrospect. So fix that, too.

Added some more explanatory comments, and an additional test to cover the cases discovered here.

Before After
Screenshot_2025-03-19_at_15.53.36 Screenshot_2025-03-19_at_15.52.12

How to set up and validate locally

Reproduction steps covered in the linked issue

Related to #525645 (closed)

Edited by Anna Vovchenko

Merge request reports

Loading