require("./chai.helper");
var domHelper = require("./dom.helper");

describe("removeClass", function () {
    // set up the DOM and some global variables
    beforeEach(function () {
        domHelper(
            "<div id=\"single\" class=\"red\"></div>" +
            "<div id=\"multiple1\" class=\"red green\"></div>" +
            "<div id=\"multiple2\" class=\"orange green\"></div>"
        );
    });

    it("should remove a single class from an element", function () {
        $("#single").removeClass("red");
        ($("#single").attr("class") === null).should.be.true;
    });

    it("should leave non-matching classes on an element", function () {
        $("#multiple1").removeClass("red");
        $("#multiple1").attr("class").should.equal("green");
    });

    it("should not remove any classes if element has none which match", function () {
        $("#multiple2").removeClass("red");
        $("#multiple2").attr("class").should.equal("orange green");
    });

    it("should remove multiple classes from an element", function () {
        $("#multiple1").removeClass("red green");
        ($("#multiple1").attr("class") === null).should.be.true;
    });

    it("should remove classes from multiple elements", function () {
        var greenDivs = $(".green");
        greenDivs.removeClass("red green");
        (greenDivs[0].getAttribute("class") === null).should.be.true;
        greenDivs[1].getAttribute("class").should.equal("orange");
    });
});

@@ -516,25 +516,24 @@
 %22);%0A        
-(
 $(%22#single%22)
@@ -542,34 +542,24 @@
 ttr(%22class%22)
- === null)
 .should.be.t
@@ -549,36 +549,41 @@
 ass%22).should.be.
-true
+equal(%22%22)
 ;%0A    %7D);%0A%0A    i
@@ -1099,17 +1099,16 @@
         
-(
 $(%22#mult
@@ -1124,34 +1124,24 @@
 ttr(%22class%22)
- === null)
 .should.be.t
@@ -1135,28 +1135,33 @@
 ).should.be.
-true
+equal(%22%22)
 ;%0A    %7D);%0A%0A 
@@ -1317,17 +1317,16 @@
         
-(
 greenDiv
@@ -1355,18 +1355,8 @@
 ss%22)
- === null)
 .sho
@@ -1366,12 +1366,17 @@
 .be.
-true
+equal(%22%22)
 ;%0A  

Repair tests for empty attribute class ("" instead of null)