Fix a unit test regression for tests using RB.DraftReviewBannerView.
Review Request #10935 — Created March 3, 2020 and submitted
wraps the new
RB.MenuButtonView. This is a bit more strict than the
RB.SplitButtonViewwith DOM elements actually being available on
the page. The problem is that during unit test runs, the HTML backing
RB.DraftReviewBannerViewis not available, and this ultimately leads
to assertion failures in the menu button.
This is easily solved by making sure we pass in either a DOM element or
a falsy value, rather than a jQuery object with a length of 0. This
change updates the instantiation to do that.
It also adds a big comment above it to point out this fact, for future
work on the banner. Sooner or later, we're going to want to move this to
a CSS component and change the way it's structured, and this quirk will
be important to note at that time.
All unit tests pass.
Manually tested that the review request and diff viewer pages had a
functioning draft banner and Publish button.