Skip to content

Commit 0fe68c1

Browse files
committed
Add mask assignment test to Two.Children suite
Expanded the Two.Children QUnit test to assert proper assignment and removal of masks on Two.Group. The test now expects 4 assertions and verifies that masks can be added and removed without errors.
1 parent 371a794 commit 0fe68c1

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

tests/suite/core.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ QUnit.test('Two.Collection', function (assert) {
714714
});
715715

716716
QUnit.test('Two.Children', function (assert) {
717-
assert.expect(3);
717+
assert.expect(4);
718718

719719
var group = new Two.Group();
720720
var shape = new Two.Shape();
@@ -745,10 +745,18 @@ QUnit.test('Two.Children', function (assert) {
745745
'Two.Children properly updates ids map when child id changes.'
746746
);
747747

748-
// Check to be able to add and remove masks freely without errors
749-
750-
group.mask = new Two.Rectangle(0, 0, 10, 10);
751-
group.mask = null;
748+
try {
749+
// Check to be able to add and remove masks freely without errors
750+
group.mask = new Two.Rectangle(0, 0, 10, 10);
751+
group.mask = null;
752+
assert.equal(
753+
group.mask,
754+
null,
755+
'Two.Group properly assigns and unassigns masks.'
756+
);
757+
} catch (e) {
758+
console.error(e);
759+
}
752760
});
753761

754762
QUnit.test('Two.Shape', function (assert) {

0 commit comments

Comments
 (0)