Skip to content

Commit

Permalink
Fix failing spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
kieftrav committed Nov 21, 2024
1 parent 88ea910 commit 0070da9
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ export default function VolumetricViewer ({
}) {
const { data, loading, error } = useVolumetricSubject({ onError, onReady, subject })

// Specs should skip rendering the VolumetricViewer component
// WebGL/Canvas throws exceptions when running specs due to non-browser environment
if (data === 'mock-subject-json')
return <div data-testid="subject-viewer-volumetric"></div>

const [modelState] = useState({
annotations: ModelAnnotations(),
tool: ModelTool(),
Expand All @@ -35,7 +30,11 @@ export default function VolumetricViewer ({
|| error
|| data === null;

return (isLoading)
// Specs should skip rendering the VolumetricViewer component
// WebGL/Canvas throws exceptions when running specs due to non-browser environment
return (data === 'mock-subject-json')
? <div data-testid="subject-viewer-volumetric"></div>
: (isLoading)
? <p>Loading...</p>
: (isError)
? <p>Error</p>
Expand Down

0 comments on commit 0070da9

Please sign in to comment.