From 5e0fd3c211820e1241d43605eb9e6d4477e13159 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:48:31 +1100 Subject: [PATCH 01/13] Update ArrowHelper.tests.js ArrowHelper extends from Object3D. ArrowHelper.type should be ArrowHelper. Stub missing member tests. --- test/unit/src/helpers/ArrowHelper.tests.js | 55 ++++++++++++++++++++-- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/test/unit/src/helpers/ArrowHelper.tests.js b/test/unit/src/helpers/ArrowHelper.tests.js index 8da678e61d2adc..b688469aa12918 100644 --- a/test/unit/src/helpers/ArrowHelper.tests.js +++ b/test/unit/src/helpers/ArrowHelper.tests.js @@ -1,15 +1,21 @@ /* global QUnit */ -// import { ArrowHelper } from '../../../../src/helpers/ArrowHelper.js'; +import { ArrowHelper } from '../../../../src/helpers/ArrowHelper.js'; + +import { Object3D } from '../../../../src/core/Object3D.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'ArrowHelper', () => { // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const object = new ArrowHelper(); + assert.strictEqual( + object instanceof Object3D, true, + 'ArrowHelper extends from Object3D' + ); } ); @@ -20,7 +26,36 @@ export default QUnit.module( 'Helpers', () => { } ); - // PUBLIC STUFF + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const object = new ArrowHelper(); + assert.ok( + object.type === 'ArrowHelper', + 'ArrowHelper.type should be ArrowHelper' + ); + + } ); + + QUnit.todo( 'position', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'line', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'cone', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + // PUBLIC QUnit.todo( 'setDirection', ( assert ) => { assert.ok( false, 'everything\'s gonna be alright' ); @@ -39,6 +74,18 @@ export default QUnit.module( 'Helpers', () => { } ); + QUnit.todo( 'copy', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'dispose', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + } ); } ); From c9aa4d00ce27ef8814eefbf0b9dfef354189828f Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:49:11 +1100 Subject: [PATCH 02/13] Update AxesHelper.tests.js AxesHelper extends from LineSegments. AxesHelper.type should be AxesHelper. Stub missing member tests. --- test/unit/src/helpers/AxesHelper.tests.js | 36 +++++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/test/unit/src/helpers/AxesHelper.tests.js b/test/unit/src/helpers/AxesHelper.tests.js index d508b0ae78c700..343c0519bf49c5 100644 --- a/test/unit/src/helpers/AxesHelper.tests.js +++ b/test/unit/src/helpers/AxesHelper.tests.js @@ -1,15 +1,21 @@ /* global QUnit */ -// import { AxesHelper } from '../../../../src/helpers/AxesHelper.js'; +import { AxesHelper } from '../../../../src/helpers/AxesHelper.js'; + +import { LineSegments } from '../../../../src/objects/LineSegments.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'AxesHelper', () => { // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const object = new AxesHelper(); + assert.strictEqual( + object instanceof LineSegments, true, + 'AxesHelper extends from LineSegments' + ); } ); @@ -20,6 +26,30 @@ export default QUnit.module( 'Helpers', () => { } ); + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const object = new AxesHelper(); + assert.ok( + object.type === 'AxesHelper', + 'AxesHelper.type should be AxesHelper' + ); + + } ); + + // PUBLIC + QUnit.todo( 'setColors', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'dispose', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + } ); } ); From 2e54d9fb608747421448d01c90794c7560ce9b78 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:50:21 +1100 Subject: [PATCH 03/13] Update Box3Helper.tests.js Box3Helper extends from LineSegments. Box3Helper.type should be Box3Helper. Stub missing member tests. --- test/unit/src/helpers/Box3Helper.tests.js | 37 ++++++++++++++++++++--- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/test/unit/src/helpers/Box3Helper.tests.js b/test/unit/src/helpers/Box3Helper.tests.js index 861186251ddee3..763cdcccba6af6 100644 --- a/test/unit/src/helpers/Box3Helper.tests.js +++ b/test/unit/src/helpers/Box3Helper.tests.js @@ -1,15 +1,21 @@ /* global QUnit */ -// import { Box3Helper } from '../../../../src/helpers/Box3Helper.js'; +import { Box3Helper } from '../../../../src/helpers/Box3Helper.js'; + +import { LineSegments } from '../../../../src/objects/LineSegments.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'Box3Helper', () => { // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const object = new Box3Helper(); + assert.strictEqual( + object instanceof LineSegments, true, + 'Box3Helper extends from LineSegments' + ); } ); @@ -20,13 +26,36 @@ export default QUnit.module( 'Helpers', () => { } ); - // PUBLIC STUFF + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const object = new Box3Helper(); + assert.ok( + object.type === 'Box3Helper', + 'Box3Helper.type should be Box3Helper' + ); + + } ); + + QUnit.todo( 'box', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + // PUBLIC QUnit.todo( 'updateMatrixWorld', ( assert ) => { assert.ok( false, 'everything\'s gonna be alright' ); } ); + QUnit.todo( 'dispose', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + } ); } ); From bc3bc0ad3e801716407b61badb642243ea1b137e Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:51:07 +1100 Subject: [PATCH 04/13] Update BoxHelper.tests.js BoxHelper extends from LineSegments. BoxHelper.type should be BoxHelper. Stub missing member tests. --- test/unit/src/helpers/BoxHelper.tests.js | 49 ++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/test/unit/src/helpers/BoxHelper.tests.js b/test/unit/src/helpers/BoxHelper.tests.js index 28cf34566c1b1a..9c425b5ba9fce9 100644 --- a/test/unit/src/helpers/BoxHelper.tests.js +++ b/test/unit/src/helpers/BoxHelper.tests.js @@ -1,7 +1,9 @@ /* global QUnit */ -import { runStdGeometryTests } from '../../utils/qunit-utils.js'; import { BoxHelper } from '../../../../src/helpers/BoxHelper.js'; + +import { LineSegments } from '../../../../src/objects/LineSegments.js'; +import { runStdGeometryTests } from '../../utils/qunit-utils.js'; import { BoxGeometry } from '../../../../src/geometries/BoxGeometry.js'; import { SphereGeometry } from '../../../../src/geometries/SphereGeometry.js'; import { Mesh } from '../../../../src/objects/Mesh.js'; @@ -29,9 +31,13 @@ export default QUnit.module( 'Helpers', () => { } ); // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const object = new BoxHelper(); + assert.strictEqual( + object instanceof LineSegments, true, + 'BoxHelper extends from LineSegments' + ); } ); @@ -42,7 +48,30 @@ export default QUnit.module( 'Helpers', () => { } ); - // PUBLIC STUFF + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const object = new BoxHelper(); + assert.ok( + object.type === 'BoxHelper', + 'BoxHelper.type should be BoxHelper' + ); + + } ); + + QUnit.todo( 'object', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrixAutoUpdate', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + // PUBLIC QUnit.todo( 'update', ( assert ) => { assert.ok( false, 'everything\'s gonna be alright' ); @@ -55,6 +84,18 @@ export default QUnit.module( 'Helpers', () => { } ); + QUnit.todo( 'copy', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'dispose', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + // OTHERS QUnit.test( 'Standard geometry tests', ( assert ) => { From 8c13a1aff8ac39955a4e82d760536db18f3e6740 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:51:49 +1100 Subject: [PATCH 05/13] Update CameraHelper.tests.js CameraHelper extends from LineSegments. CameraHelper.type should be CameraHelper. Stub missing member tests. --- test/unit/src/helpers/CameraHelper.tests.js | 63 +++++++++++++++++++-- 1 file changed, 59 insertions(+), 4 deletions(-) diff --git a/test/unit/src/helpers/CameraHelper.tests.js b/test/unit/src/helpers/CameraHelper.tests.js index d98e2ef81357d2..93576ac97fc732 100644 --- a/test/unit/src/helpers/CameraHelper.tests.js +++ b/test/unit/src/helpers/CameraHelper.tests.js @@ -1,15 +1,23 @@ /* global QUnit */ -// import { CameraHelper } from '../../../../src/helpers/CameraHelper.js'; +import { CameraHelper } from '../../../../src/helpers/CameraHelper.js'; + +import { LineSegments } from '../../../../src/objects/LineSegments.js'; +import { PerspectiveCamera } from '../../../../src/cameras/PerspectiveCamera.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'CameraHelper', () => { // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const camera = new PerspectiveCamera(); + const object = new CameraHelper( camera ); + assert.strictEqual( + object instanceof LineSegments, true, + 'CameraHelper extends from LineSegments' + ); } ); @@ -20,13 +28,60 @@ export default QUnit.module( 'Helpers', () => { } ); - // PUBLIC STUFF + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const camera = new PerspectiveCamera(); + const object = new CameraHelper( camera ); + assert.ok( + object.type === 'CameraHelper', + 'CameraHelper.type should be CameraHelper' + ); + + } ); + + QUnit.todo( 'camera', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrix', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrixAutoUpdate', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'pointMap', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + // PUBLIC + QUnit.todo( 'setColors', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + QUnit.todo( 'update', ( assert ) => { assert.ok( false, 'everything\'s gonna be alright' ); } ); + QUnit.todo( 'dispose', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); } ); From 4b62773eecbfa2a7bf930fe5bbc0e4b6f7b11059 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:52:51 +1100 Subject: [PATCH 06/13] Update DirectionalLightHelper.tests.js DirectionalLightHelper extends from Object3D. DirectionalLightHelper.type should be DirectionalLightHelper. Stub missing member tests. --- .../helpers/DirectionalLightHelper.tests.js | 58 +++++++++++++++++-- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/test/unit/src/helpers/DirectionalLightHelper.tests.js b/test/unit/src/helpers/DirectionalLightHelper.tests.js index c4e8ac3654d4f4..cf52323a3a9d11 100644 --- a/test/unit/src/helpers/DirectionalLightHelper.tests.js +++ b/test/unit/src/helpers/DirectionalLightHelper.tests.js @@ -1,15 +1,29 @@ /* global QUnit */ -// import { DirectionalLightHelper } from '../../../../src/helpers/DirectionalLightHelper.js'; +import { DirectionalLightHelper } from '../../../../src/helpers/DirectionalLightHelper.js'; + +import { Object3D } from '../../../../src/core/Object3D.js'; +import { DirectionalLight } from '../../../../src/lights/DirectionalLight.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'DirectionalLightHelper', () => { + const parameters = { + size: 1, + color: 0xaaaaaa, + intensity: 0.8 + }; + // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const light = new DirectionalLight( parameters.color ); + const object = new DirectionalLightHelper( light, parameters.size, parameters.color ); + assert.strictEqual( + object instanceof Object3D, true, + 'DirectionalLightHelper extends from Object3D' + ); } ); @@ -20,7 +34,43 @@ export default QUnit.module( 'Helpers', () => { } ); - // PUBLIC STUFF + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const light = new DirectionalLight( parameters.color ); + const object = new DirectionalLightHelper( light, parameters.size, parameters.color ); + assert.ok( + object.type === 'DirectionalLightHelper', + 'DirectionalLightHelper.type should be DirectionalLightHelper' + ); + + } ); + + QUnit.todo( 'light', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrix', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrixAutoUpdate', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'color', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + // PUBLIC QUnit.todo( 'dispose', ( assert ) => { assert.ok( false, 'everything\'s gonna be alright' ); From a56fdc7d06da34eacdae52338724aba7a77aabd7 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:54:03 +1100 Subject: [PATCH 07/13] Update GridHelper.tests.js GridHelper extends from LineSegments. GridHelper.type should be GridHelper. Stub missing member tests. --- test/unit/src/helpers/GridHelper.tests.js | 30 ++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/test/unit/src/helpers/GridHelper.tests.js b/test/unit/src/helpers/GridHelper.tests.js index 9420cb7feaa5f2..e6cb0a65bc3ea7 100644 --- a/test/unit/src/helpers/GridHelper.tests.js +++ b/test/unit/src/helpers/GridHelper.tests.js @@ -1,15 +1,21 @@ /* global QUnit */ -// import { GridHelper } from '../../../../src/helpers/GridHelper.js'; +import { GridHelper } from '../../../../src/helpers/GridHelper.js'; + +import { LineSegments } from '../../../../src/objects/LineSegments.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'GridHelper', () => { // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const object = new GridHelper(); + assert.strictEqual( + object instanceof LineSegments, true, + 'GridHelper extends from LineSegments' + ); } ); @@ -20,6 +26,24 @@ export default QUnit.module( 'Helpers', () => { } ); + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const object = new GridHelper(); + assert.ok( + object.type === 'GridHelper', + 'GridHelper.type should be GridHelper' + ); + + } ); + + // PUBLIC + QUnit.todo( 'dispose', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + } ); } ); From 515f99f53468a75ccae5ac085ec929eb7e0b01a0 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:54:49 +1100 Subject: [PATCH 08/13] Update HemisphereLightHelper.tests.js HemisphereLightHelper extends from Object3D. HemisphereLightHelper.type should be HemisphereLightHelper. Stub missing member tests. --- .../helpers/HemisphereLightHelper.tests.js | 66 +++++++++++++++++-- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/test/unit/src/helpers/HemisphereLightHelper.tests.js b/test/unit/src/helpers/HemisphereLightHelper.tests.js index bac182093c8222..180f8be3e7d231 100644 --- a/test/unit/src/helpers/HemisphereLightHelper.tests.js +++ b/test/unit/src/helpers/HemisphereLightHelper.tests.js @@ -1,15 +1,31 @@ /* global QUnit */ -// import { HemisphereLightHelper } from '../../../../src/helpers/HemisphereLightHelper.js'; +import { HemisphereLightHelper } from '../../../../src/helpers/HemisphereLightHelper.js'; + +import { Object3D } from '../../../../src/core/Object3D.js'; +import { HemisphereLight } from '../../../../src/lights/HemisphereLight.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'HemisphereLightHelper', () => { + const parameters = { + size: 1, + color: 0xabc012, + skyColor: 0x123456, + groundColor: 0xabc012, + intensity: 0.6 + }; + // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const light = new HemisphereLight( parameters.skyColor ); + const object = new HemisphereLightHelper( light, parameters.size, parameters.color ); + assert.strictEqual( + object instanceof Object3D, true, + 'HemisphereLightHelper extends from Object3D' + ); } ); @@ -20,7 +36,49 @@ export default QUnit.module( 'Helpers', () => { } ); - // PUBLIC STUFF + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const light = new HemisphereLight( parameters.skyColor ); + const object = new HemisphereLightHelper( light, parameters.size, parameters.color ); + assert.ok( + object.type === 'HemisphereLightHelper', + 'HemisphereLightHelper.type should be HemisphereLightHelper' + ); + + } ); + + QUnit.todo( 'light', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrix', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrixAutoUpdate', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'color', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'material', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + // PUBLIC QUnit.todo( 'dispose', ( assert ) => { assert.ok( false, 'everything\'s gonna be alright' ); From 17bc859b3d0501923127a2f10b9712fd360ee69f Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:55:29 +1100 Subject: [PATCH 09/13] Update PlaneHelper.tests.js PlaneHelper extends from Line. PlaneHelper.type should be PlaneHelper. Stub missing member tests. --- test/unit/src/helpers/PlaneHelper.tests.js | 42 +++++++++++++++++++--- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/test/unit/src/helpers/PlaneHelper.tests.js b/test/unit/src/helpers/PlaneHelper.tests.js index 94b15233a072b7..1e20191db11fb9 100644 --- a/test/unit/src/helpers/PlaneHelper.tests.js +++ b/test/unit/src/helpers/PlaneHelper.tests.js @@ -1,15 +1,21 @@ /* global QUnit */ -// import { PlaneHelper } from '../../../../src/helpers/PlaneHelper.js'; +import { PlaneHelper } from '../../../../src/helpers/PlaneHelper.js'; + +import { Line } from '../../../../src/objects/Line.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'PlaneHelper', () => { // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const object = new PlaneHelper(); + assert.strictEqual( + object instanceof Line, true, + 'PlaneHelper extends from Line' + ); } ); @@ -20,13 +26,41 @@ export default QUnit.module( 'Helpers', () => { } ); - // PUBLIC STUFF + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const object = new PlaneHelper(); + assert.ok( + object.type === 'PlaneHelper', + 'PlaneHelper.type should be PlaneHelper' + ); + + } ); + + QUnit.todo( 'plane', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'size', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + // PUBLIC QUnit.todo( 'updateMatrixWorld', ( assert ) => { assert.ok( false, 'everything\'s gonna be alright' ); } ); + QUnit.todo( 'dispose', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); } ); From 6834494f6db7565a8d38fe293e47b4bd20286b2a Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:56:15 +1100 Subject: [PATCH 10/13] Update PointLightHelper.tests.js PointLightHelper extends from Mesh. PointLightHelper.type should be PointLightHelper. Stub missing member tests. --- .../src/helpers/PointLightHelper.tests.js | 60 +++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/test/unit/src/helpers/PointLightHelper.tests.js b/test/unit/src/helpers/PointLightHelper.tests.js index 62d50e32d74106..8785fcfc6e9424 100644 --- a/test/unit/src/helpers/PointLightHelper.tests.js +++ b/test/unit/src/helpers/PointLightHelper.tests.js @@ -1,15 +1,31 @@ /* global QUnit */ -// import { PointLightHelper } from '../../../../src/helpers/PointLightHelper.js'; +import { PointLightHelper } from '../../../../src/helpers/PointLightHelper.js'; + +import { Mesh } from '../../../../src/objects/Mesh.js'; +import { PointLight } from '../../../../src/lights/PointLight.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'PointLightHelper', () => { + const parameters = { + sphereSize: 1, + color: 0xaaaaaa, + intensity: 0.5, + distance: 100, + decay: 2 + }; + // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const light = new PointLight( parameters.color ); + const object = new PointLightHelper( light, parameters.sphereSize, parameters.color ); + assert.strictEqual( + object instanceof Mesh, true, + 'PointLightHelper extends from Mesh' + ); } ); @@ -20,7 +36,43 @@ export default QUnit.module( 'Helpers', () => { } ); - // PUBLIC STUFF + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const light = new PointLight( parameters.color ); + const object = new PointLightHelper( light, parameters.sphereSize, parameters.color ); + assert.ok( + object.type === 'PointLightHelper', + 'PointLightHelper.type should be PointLightHelper' + ); + + } ); + + QUnit.todo( 'light', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'color', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrix', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrixAutoUpdate', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + // PUBLIC QUnit.todo( 'dispose', ( assert ) => { assert.ok( false, 'everything\'s gonna be alright' ); From f61b8aab244ae670e253019c181ed0a0bed063a7 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:56:54 +1100 Subject: [PATCH 11/13] Update PolarGridHelper.tests.js PolarGridHelper extends from LineSegments. PolarGridHelper.type should be PolarGridHelper. Stub missing member tests. --- .../unit/src/helpers/PolarGridHelper.tests.js | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/test/unit/src/helpers/PolarGridHelper.tests.js b/test/unit/src/helpers/PolarGridHelper.tests.js index 37974e36328ea6..479b5f74316f2e 100644 --- a/test/unit/src/helpers/PolarGridHelper.tests.js +++ b/test/unit/src/helpers/PolarGridHelper.tests.js @@ -1,15 +1,21 @@ /* global QUnit */ -// import { PolarGridHelper } from '../../../../src/helpers/PolarGridHelper.js'; +import { PolarGridHelper } from '../../../../src/helpers/PolarGridHelper.js'; + +import { LineSegments } from '../../../../src/objects/LineSegments.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'PolarGridHelper', () => { // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const object = new PolarGridHelper(); + assert.strictEqual( + object instanceof LineSegments, true, + 'PolarGridHelper extends from LineSegments' + ); } ); @@ -20,6 +26,24 @@ export default QUnit.module( 'Helpers', () => { } ); + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const object = new PolarGridHelper(); + assert.ok( + object.type === 'PolarGridHelper', + 'PolarGridHelper.type should be PolarGridHelper' + ); + + } ); + + // PUBLIC + QUnit.todo( 'dispose', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + } ); } ); From d2ee65f64d0dc6a9a54f3885b2b6be1bed1eb755 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:57:50 +1100 Subject: [PATCH 12/13] Update SkeletonHelper.tests.js SkeletonHelper extends from LineSegments. SkeletonHelper.type should be SkeletonHelper. SkeletonHelper.isSkeletonHelper should be true. Stub missing member tests. --- test/unit/src/helpers/SkeletonHelper.tests.js | 68 +++++++++++++++++-- 1 file changed, 64 insertions(+), 4 deletions(-) diff --git a/test/unit/src/helpers/SkeletonHelper.tests.js b/test/unit/src/helpers/SkeletonHelper.tests.js index d6b93ee94f8654..3bd4f9d4f3eeba 100644 --- a/test/unit/src/helpers/SkeletonHelper.tests.js +++ b/test/unit/src/helpers/SkeletonHelper.tests.js @@ -1,15 +1,23 @@ /* global QUnit */ -// import { SkeletonHelper } from '../../../../src/helpers/SkeletonHelper.js'; +import { SkeletonHelper } from '../../../../src/helpers/SkeletonHelper.js'; + +import { LineSegments } from '../../../../src/objects/LineSegments.js'; +import { Bone } from '../../../../src/objects/Bone.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'SkeletonHelper', () => { // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const bone = new Bone(); + const object = new SkeletonHelper( bone ); + assert.strictEqual( + object instanceof LineSegments, true, + 'SkeletonHelper extends from LineSegments' + ); } ); @@ -20,13 +28,65 @@ export default QUnit.module( 'Helpers', () => { } ); - // PUBLIC STUFF + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const bone = new Bone(); + const object = new SkeletonHelper( bone ); + assert.ok( + object.type === 'SkeletonHelper', + 'SkeletonHelper.type should be SkeletonHelper' + ); + + } ); + + QUnit.todo( 'root', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'bones', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrix', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrixAutoUpdate', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + // PUBLIC + QUnit.test( 'isSkeletonHelper', ( assert ) => { + + const bone = new Bone(); + const object = new SkeletonHelper( bone ); + assert.ok( + object.isSkeletonHelper, + 'SkeletonHelper.isSkeletonHelper should be true' + ); + + } ); + QUnit.todo( 'updateMatrixWorld', ( assert ) => { assert.ok( false, 'everything\'s gonna be alright' ); } ); + QUnit.todo( 'dispose', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); } ); From bc938fdc6f3efe9d4cb4b8164d5191d8d7cc7a46 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 2 Feb 2023 00:58:34 +1100 Subject: [PATCH 13/13] Update SpotLightHelper.tests.js SpotLightHelper extends from Object3D. SpotLightHelper.type should be SpotLightHelper. Stub missing member tests. --- .../unit/src/helpers/SpotLightHelper.tests.js | 67 +++++++++++++++++-- 1 file changed, 63 insertions(+), 4 deletions(-) diff --git a/test/unit/src/helpers/SpotLightHelper.tests.js b/test/unit/src/helpers/SpotLightHelper.tests.js index 6acb3189c0e141..c9d3afa72c2420 100644 --- a/test/unit/src/helpers/SpotLightHelper.tests.js +++ b/test/unit/src/helpers/SpotLightHelper.tests.js @@ -1,15 +1,32 @@ /* global QUnit */ -// import { SpotLightHelper } from '../../../../src/helpers/SpotLightHelper.js'; +import { SpotLightHelper } from '../../../../src/helpers/SpotLightHelper.js'; + +import { Object3D } from '../../../../src/core/Object3D.js'; +import { SpotLight } from '../../../../src/lights/SpotLight.js'; export default QUnit.module( 'Helpers', () => { QUnit.module( 'SpotLightHelper', () => { + const parameters = { + color: 0xaaaaaa, + intensity: 0.5, + distance: 100, + angle: 0.8, + penumbra: 8, + decay: 2 + }; + // INHERITANCE - QUnit.todo( 'Extending', ( assert ) => { + QUnit.test( 'Extending', ( assert ) => { - assert.ok( false, 'everything\'s gonna be alright' ); + const light = new SpotLight( parameters.color ); + const object = new SpotLightHelper( light, parameters.color ); + assert.strictEqual( + object instanceof Object3D, true, + 'SpotLightHelper extends from Object3D' + ); } ); @@ -20,7 +37,49 @@ export default QUnit.module( 'Helpers', () => { } ); - // PUBLIC STUFF + // PROPERTIES + QUnit.test( 'type', ( assert ) => { + + const light = new SpotLight( parameters.color ); + const object = new SpotLightHelper( light, parameters.color ); + assert.ok( + object.type === 'SpotLightHelper', + 'SpotLightHelper.type should be SpotLightHelper' + ); + + } ); + + QUnit.todo( 'light', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrix', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'matrixAutoUpdate', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'color', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + QUnit.todo( 'cone', ( assert ) => { + + assert.ok( false, 'everything\'s gonna be alright' ); + + } ); + + // PUBLIC QUnit.todo( 'dispose', ( assert ) => { assert.ok( false, 'everything\'s gonna be alright' );