SpotLightShadow.tests.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * @author TristanVALCKE / https://github.com/Itee
  3. * @author moraxy / https://github.com/moraxy
  4. */
  5. /* global QUnit */
  6. import { SpotLightShadow } from '../../../../src/lights/SpotLightShadow';
  7. import { SpotLight } from '../../../../src/lights/SpotLight';
  8. import { ObjectLoader } from '../../../../src/loaders/ObjectLoader';
  9. export default QUnit.module( 'Lights', () => {
  10. QUnit.module.todo( 'SpotLightShadow', () => {
  11. // INHERITANCE
  12. QUnit.test( "Extending", ( assert ) => {
  13. assert.ok( false, "everything's gonna be alright" );
  14. } );
  15. // INSTANCING
  16. QUnit.test( "Instancing", ( assert ) => {
  17. assert.ok( false, "everything's gonna be alright" );
  18. } );
  19. // PUBLIC STUFF
  20. QUnit.test( "isSpotLightShadow", ( assert ) => {
  21. assert.ok( false, "everything's gonna be alright" );
  22. } );
  23. QUnit.test( "update", ( assert ) => {
  24. assert.ok( false, "everything's gonna be alright" );
  25. } );
  26. // OTHERS
  27. QUnit.test( "clone/copy", ( assert ) => {
  28. var a = new SpotLightShadow();
  29. var b = new SpotLightShadow();
  30. var c;
  31. assert.notDeepEqual( a, b, "Newly instanced shadows are not equal" );
  32. c = a.clone();
  33. assert.smartEqual( a, c, "Shadows are identical after clone()" );
  34. c.mapSize.set( 256, 256 );
  35. assert.notDeepEqual( a, c, "Shadows are different again after change" );
  36. b.copy( a );
  37. assert.smartEqual( a, b, "Shadows are identical after copy()" );
  38. b.mapSize.set( 512, 512 );
  39. assert.notDeepEqual( a, b, "Shadows are different again after change" );
  40. } );
  41. QUnit.test( "toJSON", ( assert ) => {
  42. var light = new SpotLight();
  43. var shadow = new SpotLightShadow();
  44. shadow.bias = 10;
  45. shadow.radius = 5;
  46. shadow.mapSize.set( 128, 128 );
  47. light.shadow = shadow;
  48. var json = light.toJSON();
  49. var newLight = new ObjectLoader().parse( json );
  50. assert.smartEqual( newLight.shadow, light.shadow, "Reloaded shadow is equal to the original one" );
  51. } );
  52. } );
  53. } );
粤ICP备19079148号