-
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.
- Loading branch information
1 parent
dd83eb0
commit 78e1a68
Showing
2 changed files
with
23 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,22 @@ | ||
import vtkRenderer from '@kitware/vtk.js/Rendering/Core/Renderer.js' | ||
import { setupLights } from '../lights.js'; | ||
|
||
describe('Set up Lights Test', () => { | ||
const rendererns = vtkRenderer.newInstance() | ||
const urlns = new URL('https://test.com?nospjjotlight') | ||
const lightsBefore = rendererns.getLights().length | ||
it('should run without spotlight', () => { | ||
setupLights (urlns, rendererns) | ||
const lightsAfter = rendererns.getLights().length | ||
console.log(lightsBefore + ' : ' + lightsAfter) | ||
expect(lightsAfter).toBe(lightsBefore) | ||
}); | ||
|
||
const url = new URL('https://test.com?spotlight') | ||
const renderer = vtkRenderer.newInstance() | ||
const lightsBeforeSpot = renderer.getLights().length | ||
it('should add a spotlight', () => { | ||
setupLights (url, renderer) | ||
expect(renderer.getLights().length).toBe(lightsBeforeSpot + 1) | ||
}); | ||
}); |