-
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.
Merge pull request #18 from 2gis/TILES-5179-tests-for-new-gltf-plugin
TILES-5179 tests for public methods
- Loading branch information
Showing
17 changed files
with
212 additions
and
21 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
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
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import { GltfPlugin } from '../src'; | ||
import { OBJECTS_FOR_TESTS } from './utils'; | ||
import { realtyScene } from '../demo/realtySceneData'; | ||
|
||
window.GltfPlugin = GltfPlugin; | ||
window.OBJECTS_FOR_TESTS = OBJECTS_FOR_TESTS; // storage for any data for tests | ||
window.OBJECTS_FOR_TESTS.mapRealtyScene = realtyScene; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.4 KB
test/screenshots/__screenshots__/plugin/add_models_partially-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import type { Map } from '@2gis/mapgl/types'; | ||
import { GltfPlugin } from '../src'; | ||
import { OBJECTS_FOR_TESTS } from './utils'; | ||
|
||
declare global { | ||
interface Window { | ||
map: Map; | ||
gltfPlugin: GltfPlugin; | ||
GltfPlugin: typeof GltfPlugin; | ||
ready: boolean; | ||
OBJECTS_FOR_TESTS: OBJECTS_FOR_TESTS; | ||
} | ||
} |
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,67 @@ | ||
/** | ||
* @param ms | ||
* Pause script exec of milliseconds | ||
* */ | ||
export function sleep(ms: number) { | ||
return new Promise((resolve) => setTimeout(resolve, ms)); | ||
} | ||
/** | ||
* Models and poi's for create objects at the scene | ||
* */ | ||
export const OBJECTS_FOR_TESTS = { | ||
models: { | ||
cubeBig: { | ||
modelId: 1, | ||
coordinates: [82.886554, 54.98085], | ||
modelUrl: 'models/cube_draco.glb', | ||
rotateX: 90, | ||
scale: 500, | ||
}, | ||
cubeSmall: { | ||
modelId: 2, | ||
coordinates: [82.886454, 54.980588], | ||
modelUrl: 'models/cube_draco.glb', | ||
rotateX: 90, | ||
rotateY: 31, | ||
scale: 250, | ||
}, | ||
}, | ||
poi: { | ||
asciiLetters: { | ||
id: 1, | ||
type: 'primary', | ||
minZoom: 12, | ||
elevation: 40, | ||
fontSize: 10, | ||
fontColor: '#aa3a3a', | ||
data: [ | ||
{ | ||
coordinates: [82.886454, 54.98075], | ||
elevation: 30, | ||
label: '@<>?|!@#$%\n^&*()_+-=\n3к\n78.4 м²', | ||
userData: { | ||
url: 'https://example.com/', | ||
}, | ||
}, | ||
], | ||
}, | ||
engRusLetters: { | ||
id: 2, | ||
type: 'secondary', | ||
minZoom: 12, | ||
elevation: 20, | ||
fontSize: 10, | ||
fontColor: '#3a3a3a', | ||
data: [ | ||
{ | ||
coordinates: [82.886104, 54.98075], | ||
elevation: 30, | ||
label: 'qwe RTY пои ГРУП', | ||
userData: { | ||
url: 'https://example.com/', | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
}; |