Update major Node.js dependency versions and fix tests where needed
The bot MR for updating major Node.js dependencies: !1968 (closed) failed because of failing jest
tests: https://gitlab.com/gitlab-renovate-forks/gitlab-docs/-/jobs/1433438164.
The cause is because the new version of Jest that the MR moved us to has different defaults: https://jestjs.io/blog/2021/05/25/jest-27#flipping-defaults. As suggested, I used https://jestjs.io/docs/configuration#testenvironment-string to set test environment to jsdom
where needed.
CC @axil @marcel.amirault CC @fneill (just FYI).
Edited by Evan Read