PlaneGeometry.tests.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* global QUnit */
  2. import { PlaneGeometry } from '../../../../src/geometries/PlaneGeometry.js';
  3. import { BufferGeometry } from '../../../../src/core/BufferGeometry.js';
  4. import { runStdGeometryTests } from '../../utils/qunit-utils.js';
  5. export default QUnit.module( 'Geometries', () => {
  6. QUnit.module( 'PlaneGeometry', ( hooks ) => {
  7. let geometries = undefined;
  8. hooks.beforeEach( function () {
  9. const parameters = {
  10. width: 10,
  11. height: 30,
  12. widthSegments: 3,
  13. heightSegments: 5
  14. };
  15. geometries = [
  16. new PlaneGeometry(),
  17. new PlaneGeometry( parameters.width ),
  18. new PlaneGeometry( parameters.width, parameters.height ),
  19. new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments ),
  20. new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments, parameters.heightSegments ),
  21. ];
  22. } );
  23. // INHERITANCE
  24. QUnit.test( 'Extending', ( assert ) => {
  25. const object = new PlaneGeometry();
  26. assert.strictEqual(
  27. object instanceof BufferGeometry, true,
  28. 'PlaneGeometry extends from BufferGeometry'
  29. );
  30. } );
  31. // INSTANCING
  32. QUnit.test( 'Instancing', ( assert ) => {
  33. const object = new PlaneGeometry();
  34. assert.ok( object, 'Can instantiate a PlaneGeometry.' );
  35. } );
  36. // PROPERTIES
  37. QUnit.test( 'type', ( assert ) => {
  38. const object = new PlaneGeometry();
  39. assert.ok(
  40. object.type === 'PlaneGeometry',
  41. 'PlaneGeometry.type should be PlaneGeometry'
  42. );
  43. } );
  44. QUnit.todo( 'parameters', ( assert ) => {
  45. assert.ok( false, 'everything\'s gonna be alright' );
  46. } );
  47. // STATIC
  48. QUnit.todo( 'fromJSON', ( assert ) => {
  49. assert.ok( false, 'everything\'s gonna be alright' );
  50. } );
  51. // OTHERS
  52. QUnit.test( 'Standard geometry tests', ( assert ) => {
  53. runStdGeometryTests( assert, geometries );
  54. } );
  55. } );
  56. } );