      connectedCallback() { reactions.push(this.isConnected); }
                disconnectedCallback() { reactions.push(this.isConnected); }
            });
        const element = document.createElement(element_name);
        t.add_cleanup(() => element.remove());
        document.body.append(element);
        await Promise.resolve();
        reactions = [];
        document.getElementById("section").moveBefore(element, null);
        await Promise.resolve();
        assert_array_equals(reactions, [true, t