Skip to content

Commit 90d288f

Browse files
authored
Merge pull request #20963 from takahirox/DefaultMatrixAutoUpdateTest
Tests: Add Object3D.DefaultMatrixAutoUpdate unit test
2 parents 6eee336 + db5db5f commit 90d288f

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

test/unit/src/core/Object3D.tests.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,29 @@ export default QUnit.module( 'Core', () => {
5858

5959
} );
6060

61-
QUnit.todo( "DefaultMatrixAutoUpdate", ( assert ) => {
61+
QUnit.test( "DefaultMatrixAutoUpdate", ( assert ) => {
6262

63-
assert.ok( false, "everything's gonna be alright" );
63+
const currentDefaultMatrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate;
64+
65+
try {
66+
67+
assert.equal( currentDefaultMatrixAutoUpdate, true, "default DefaultMatrixAutoUpdate is true" );
68+
69+
const object = new Object3D();
70+
71+
assert.equal( object.matrixAutoUpdate, true, ".matrixAutoUpdate of a new object inherits Object3D.DefaultMatrixAutoUpdate = true" );
72+
73+
Object3D.DefaultMatrixAutoUpdate = false;
74+
75+
const object2 = new Object3D();
76+
77+
assert.equal( object2.matrixAutoUpdate, false, ".matrixAutoUpdate of a new object inherits Object3D.DefaultMatrixAutoUpdate = false" );
78+
79+
} finally {
80+
81+
Object3D.DefaultMatrixAutoUpdate = currentDefaultMatrixAutoUpdate;
82+
83+
}
6484

6585
} );
6686

0 commit comments

Comments
 (0)