Skip to content

Commit ed1609d

Browse files
committed
Add few tests to improve accuracy
1st "it" prevent hardcoding of arr.splice (e.g. arr.splice(0,1) ); 2nd "it" verify presence of "i--" modification.
1 parent 26af6c1 commit ed1609d

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

  • 1-js/4-data-structures/8-array-methods/3-remove-class/_js.view

1-js/4-data-structures/8-array-methods/3-remove-class/_js.view/test.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,25 @@ describe("removeClass", function() {
3939
className: ""
4040
});
4141
});
42+
43+
it("удаляет класс из середины списка", function() {
44+
var obj = {
45+
className: "open menu now"
46+
};
47+
removeClass(obj, 'menu');
48+
assert.deepEqual(obj, {
49+
className: "open now"
50+
});
51+
});
52+
53+
it("удаляет повторяющийся класс из середины списка", function() {
54+
var obj = {
55+
className: "open menu menu zero"
56+
};
57+
removeClass(obj, 'menu');
58+
assert.deepEqual(obj, {
59+
className: "open zero"
60+
});
61+
});
4262

43-
});
63+
});

0 commit comments

Comments
 (0)