zjsunit: Clear $ elements in run_test.

We now call $.clear_all_elements at the top
of run_test.

We have to exempt two modules from the new regime:

    compose
    settings_user_groups

Also, if modules do set_global("$", ...) we don't
try to call the non-existent function.

It's possible we'll want to move to something like
this, but we might want to clean up the two
sloppy_$ modules first:

    // AVOID THIS:
    // const $ = require("zjquery")

    run_test("test widget", ({override, $}) => {
        override(foo, "bar", ...);
        $.create(...);
        // do stuff
    });
This commit is contained in:
Steve Howell
2021-02-23 11:05:28 +00:00
committed by Steve Howell
parent 81fd1a5e6a
commit ac69450681
20 changed files with 18 additions and 33 deletions

View File

@@ -149,7 +149,8 @@ people.add_active_user(alice);
people.add_active_user(bob);
function test_ui(label, f) {
run_test(label, f);
// The sloppy_$ flag lets us re-use setup from prior tests.
run_test(label, f, {sloppy_$: true});
}
test_ui("validate_stream_message_address_info", () => {