Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Unit Tests for Helpers #25398

Merged
merged 13 commits into from
Feb 2, 2023
55 changes: 51 additions & 4 deletions test/unit/src/helpers/ArrowHelper.tests.js
Original file line number Diff line number Diff line change
@@ -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'
);

} );

Expand All @@ -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' );
Expand All @@ -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' );

} );

} );

} );
36 changes: 33 additions & 3 deletions test/unit/src/helpers/AxesHelper.tests.js
Original file line number Diff line number Diff line change
@@ -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'
);

} );

Expand All @@ -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' );

} );

} );

} );
37 changes: 33 additions & 4 deletions test/unit/src/helpers/Box3Helper.tests.js
Original file line number Diff line number Diff line change
@@ -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'
);

} );

Expand All @@ -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' );

} );

} );

} );
49 changes: 45 additions & 4 deletions test/unit/src/helpers/BoxHelper.tests.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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'
);

} );

Expand All @@ -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' );
Expand All @@ -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 ) => {

Expand Down
63 changes: 59 additions & 4 deletions test/unit/src/helpers/CameraHelper.tests.js
Original file line number Diff line number Diff line change
@@ -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'
);

} );

Expand All @@ -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' );

} );

} );

Expand Down
Loading