-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for scene parsing
- Loading branch information
Showing
2 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import expect from 'expect.js'; | ||
import Gltf from '../src/Gltf'; | ||
import WebGltfIO from '../src/io/web'; | ||
import GltfTypes from '../src/types/GltfTypes'; | ||
|
||
|
||
describe("Animation Sampler", function () { | ||
|
||
let gltf :Gltf; | ||
|
||
before(function () { | ||
return WebGltfIO.loadGltf('samples/other/khronos/lights.gltf').then( res=>gltf=res ) | ||
}); | ||
|
||
|
||
|
||
describe("scene access", function () { | ||
|
||
it("with getElement", function () { | ||
expect( gltf.getElement( GltfTypes.SCENE, 0 ) ).to.be.ok() | ||
}) | ||
|
||
it("with scenes", function () { | ||
expect( gltf.scenes.length ).to.be(1) | ||
}) | ||
|
||
}) | ||
|
||
describe("scene is ok", function () { | ||
|
||
|
||
it("scene name is set", function () { | ||
expect( gltf.scenes[0].name ).to.be("scene") | ||
}); | ||
|
||
it("scene has 3 nodes", function () { | ||
expect( gltf.scenes[0].nodes.length ).to.be(3) | ||
}); | ||
|
||
it("scene second node is ok", function () { | ||
expect( gltf.scenes[0].nodes[1].name ).to.be("directional_light") | ||
}); | ||
|
||
}); | ||
|
||
}); |