Tests: Fix errors and visual glitches seen in Chrome

(cherry picked from commit 797516a52f28534dab08032188cebb0f46fafe94)

Closes gh-7508
Fixes gh-7499