JSFiddle - React, Tailwind, and code Playground

by dmethvin

HTML

<script src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script>
<link rel="stylesheet" href="http://github.com/jquery/qunit/raw/master/qunit/qunit.css">
<h1 id="qunit-header">QUnit</h1>  
  <h2 id="qunit-banner"></h2>  
  <h2 id="qunit-userAgent"></h2>  
  <ol id="qunit-tests">  
  </ol>

JavaScript

// Trigger order

module("tests");

test("Handler changes and .trigger() order", function() {
    expect(1);

    var markup = jQuery(
        '<div><p><b class="a">b</b></p></div>'
    ).appendTo( "body" );

    var path = "";
    jQuery( "b" ).parents().bind( "click", function(e){
        path += this.nodeName.toLowerCase() + " ";
        // If this is removed the test passes
        $(this).parent().remove();
    });

    markup.find( "b" ).trigger( "click" );

    equals( path, "p div body html ", "Delivered all events" )
        
    markup.remove();
});