Line.tests.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* global QUnit */
  2. import { Line } from '../../../../src/objects/Line.js';
  3. import { Object3D } from '../../../../src/core/Object3D.js';
  4. import { Material } from '../../../../src/materials/Material.js';
  5. export default QUnit.module( 'Objects', () => {
  6. QUnit.module( 'Line', () => {
  7. // INHERITANCE
  8. QUnit.test( 'Extending', ( assert ) => {
  9. const line = new Line();
  10. assert.strictEqual(
  11. line instanceof Object3D, true,
  12. 'Line extends from Object3D'
  13. );
  14. } );
  15. // INSTANCING
  16. QUnit.test( 'Instancing', ( assert ) => {
  17. const object = new Line();
  18. assert.ok( object, 'Can instantiate a Line.' );
  19. } );
  20. // PROPERTIES
  21. QUnit.test( 'type', ( assert ) => {
  22. const object = new Line();
  23. assert.ok(
  24. object.type === 'Line',
  25. 'Line.type should be Line'
  26. );
  27. } );
  28. QUnit.todo( 'geometry', ( assert ) => {
  29. assert.ok( false, 'everything\'s gonna be alright' );
  30. } );
  31. QUnit.todo( 'material', ( assert ) => {
  32. assert.ok( false, 'everything\'s gonna be alright' );
  33. } );
  34. // PUBLIC
  35. QUnit.test( 'isLine', ( assert ) => {
  36. const object = new Line();
  37. assert.ok(
  38. object.isLine,
  39. 'Line.isLine should be true'
  40. );
  41. } );
  42. QUnit.todo( 'copy', ( assert ) => {
  43. assert.ok( false, 'everything\'s gonna be alright' );
  44. } );
  45. QUnit.test( 'copy/material', ( assert ) => {
  46. // Material arrays are cloned
  47. const mesh1 = new Line();
  48. mesh1.material = [ new Material() ];
  49. const copy1 = mesh1.clone();
  50. assert.notStrictEqual( mesh1.material, copy1.material );
  51. // Non arrays are not cloned
  52. const mesh2 = new Line();
  53. mesh1.material = new Material();
  54. const copy2 = mesh2.clone();
  55. assert.strictEqual( mesh2.material, copy2.material );
  56. } );
  57. QUnit.todo( 'computeLineDistances', ( assert ) => {
  58. assert.ok( false, 'everything\'s gonna be alright' );
  59. } );
  60. QUnit.todo( 'raycast', ( assert ) => {
  61. assert.ok( false, 'everything\'s gonna be alright' );
  62. } );
  63. QUnit.todo( 'updateMorphTargets', ( assert ) => {
  64. assert.ok( false, 'everything\'s gonna be alright' );
  65. } );
  66. QUnit.todo( 'clone', ( assert ) => {
  67. // inherited from Object3D, test instance specific behaviour.
  68. assert.ok( false, 'everything\'s gonna be alright' );
  69. } );
  70. } );
  71. } );
粤ICP备19079148号