-
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.
Move IE Detection to JS & Update Unit Tests
- Loading branch information
1 parent
91069de
commit 820b737
Showing
13 changed files
with
154 additions
and
80 deletions.
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
12 changes: 6 additions & 6 deletions
12
dist/assets/index.5ca009a5.js → dist/assets/index.d14d1cb9.js
Large diffs are not rendered by default.
Oops, something went wrong.
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,4 @@ | ||
!!window.navigator.userAgent.match(/Trident\//i) || | ||
!!window.navigator.userAgent.match(/MSIE /i) | ||
? document.documentElement.className += ' ms-ie' | ||
: document.documentElement.className = ''; |
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,4 @@ | ||
!!window.navigator.userAgent.match(/Trident\//i) || | ||
!!window.navigator.userAgent.match(/MSIE /i) | ||
? document.documentElement.className += ' ms-ie' | ||
: document.documentElement.className = ''; |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import '@/utils/DetectIE'; | ||
import { App } from '@/app'; | ||
import { render } from 'solid-js/web'; | ||
|
||
|
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 was deleted.
Oops, something went wrong.
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,56 @@ | ||
import type { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'; | ||
import { describe, test, expect, vi } from 'vitest'; | ||
import Playground from '@/playground'; | ||
|
||
vi.mock('three/src/renderers/WebGLRenderer'); | ||
|
||
interface PublicPlayground { | ||
orbitControls: OrbitControls; | ||
get domElement (): HTMLCanvasElement; | ||
set controls (enabled: boolean); | ||
set pause (paused: boolean); | ||
destroy: () => void; | ||
} | ||
|
||
describe('Playground', () => { | ||
const playground = new Playground() as unknown as PublicPlayground; | ||
|
||
test('Create', () => { | ||
expect(Playground).toBeDefined(); | ||
expect(playground).toBeInstanceOf(Playground); | ||
}); | ||
|
||
test('resize', () => { | ||
const playgroundPrototype = Object.getPrototypeOf(playground); | ||
const resize = vi.fn(playgroundPrototype.resize.bind(playground)); | ||
|
||
resize(); | ||
expect(resize).toHaveReturnedWith(undefined); | ||
}); | ||
|
||
test('destroy', () => { | ||
const destroy = vi.fn(playground.destroy.bind(playground)); | ||
destroy(); | ||
expect(destroy).toHaveReturnedWith(undefined); | ||
}); | ||
|
||
test('domElement', () => { | ||
expect(playground.domElement.tagName).toStrictEqual('CANVAS'); | ||
}); | ||
|
||
test('controls', () => { | ||
playground.controls = false; | ||
expect(playground.orbitControls.enabled).toStrictEqual(false); | ||
|
||
playground.controls = true; | ||
expect(playground.orbitControls.enabled).toStrictEqual(true); | ||
}); | ||
|
||
test('pause', () => { | ||
playground.pause = true; | ||
expect(playground.orbitControls.enabled).toStrictEqual(false); | ||
|
||
playground.pause = false; | ||
expect(playground.orbitControls.enabled).toStrictEqual(true); | ||
}); | ||
}); |
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 was deleted.
Oops, something went wrong.
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