FIX: Tests were broken in Firefox (#12456)

There are a lot of little fixes to tests here, but the biggest issue was
too much recursion because we kept replacing the helpers over and over
again. I assume Chrome has tail recursion or something to speed this up
but Firefox hated it.

Otherwise, we can't rely on the order of attributes in rendered HTML so
I simplified most of those tests to just look for key strings in the
HTML that are rendered.
This commit is contained in:
Robin Ward
2021-03-21 20:35:51 -04:00
committed by GitHub
parent d898e00242
commit 942ee1e218
7 changed files with 29 additions and 48 deletions

View File

@ -8,6 +8,10 @@ export function registerRawHelpers(hbs, handlebarsClass) {
if (!hbs.helpers) {
hbs.helpers = Object.create(handlebarsClass.helpers);
}
if (hbs.__helpers_registered) {
return;
}
hbs.__helpers_registered = true;
hbs.helpers["get"] = function (context, options) {
if (!context || !options.contexts) {