-
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
Showing
30 changed files
with
575 additions
and
68 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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
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,5 +1,7 @@ | ||
import * as sinon from 'sinon'; | ||
import { GltfPlugin } from '../src'; | ||
import { MOCKS } from './mocks'; | ||
|
||
window.GltfPlugin = GltfPlugin; | ||
window.MOCKS = MOCKS; // storage for any data for tests | ||
window.sinon = sinon; |
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,48 @@ | ||
import { Page, pageSetUp } from '../puppeteer'; | ||
import { initBlankMap, waitForReadiness } from '../puppeteer/utils'; | ||
|
||
describe('Events', () => { | ||
let page: Page; | ||
|
||
beforeEach(async () => { | ||
page = await pageSetUp(); | ||
await initBlankMap(page, { | ||
center: [47.245286302641034, 56.134743473834099], | ||
styleZoom: 18, | ||
}); | ||
await page.evaluate(() => { | ||
window.gltfPlugin = new window.GltfPlugin(window.map, { | ||
modelsBaseUrl: | ||
'https://disk.2gis.com/digital-twin/models_s3/realty_ads/zgktechnology/', | ||
}); | ||
}); | ||
}); | ||
|
||
afterEach(async () => { | ||
await page.close(); | ||
}); | ||
|
||
describe('activemodelchange', () => { | ||
it('activemodelchange is emitted on adding realty scene with a state', async () => { | ||
const buildingId = '03a234cb'; | ||
const floorId = '235034'; | ||
await page.evaluate( | ||
(buildingId, floorId) => { | ||
window.spy = window.sinon.spy(); | ||
window.gltfPlugin.on('activemodelchange', window.spy); | ||
return window.gltfPlugin.addRealtyScene(window.MOCKS.realtyScene, { | ||
buildingId, | ||
floorId, | ||
}); | ||
}, | ||
buildingId, | ||
floorId, | ||
); | ||
await waitForReadiness(page); | ||
expect(await page.evaluate(() => window.spy.firstCall.args[0])).toEqual({ | ||
buildingModelId: buildingId, | ||
floorModelId: floorId, | ||
}); | ||
}); | ||
}); | ||
}); |
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
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
Binary file modified
BIN
-63 Bytes
(99%)
test/screenshots/__screenshots__/plugin/add_label_group-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.
Binary file modified
BIN
+5.18 KB
(130%)
test/screenshots/__screenshots__/plugin/add_models-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.75 KB
(130%)
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.
Binary file modified
BIN
+268 Bytes
(100%)
test/screenshots/__screenshots__/plugin/add_realty_scene-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.82 KB
(130%)
test/screenshots/__screenshots__/plugin/change_style-snap.png
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
+1.72 KB
...ots/__screenshots__/plugin/plugin_options_default_modelsNearCameraFade-snap.png
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
+494 Bytes
...shots/__screenshots__/plugin/plugin_options_great_modelsNearCameraFade-snap.png
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
+1.06 KB
...reenshots__/plugin/plugin_options_minZoom_maxZoom_invisible_all_models-snap.png
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
+1.06 KB
..._screenshots__/plugin/plugin_options_minZoom_maxZoom_no_visible_models-snap.png
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
+16.3 KB
...screenshots__/plugin/plugin_options_minZoom_maxZoom_visible_all_models-snap.png
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
+3.68 KB
...ots/__screenshots__/plugin/plugin_options_minZoom_maxZoom_visible_cube-snap.png
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
+11.7 KB
...screenshots__/plugin/plugin_options_minZoom_maxZoom_visible_cube_again-snap.png
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
+7.87 KB
...eenshots__/plugin/plugin_options_minZoom_maxZoom_visible_cube_and_palm-snap.png
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
+16.3 KB
...eenshots__/plugin/plugin_options_minZoom_maxZoom_visible_cube_and_pine-snap.png
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
+1.52 KB
...eenshots/__screenshots__/plugin/plugin_options_no_modelsNearCameraFade-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+268 Bytes
(100%)
test/screenshots/__screenshots__/plugin/show_realty_scene-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.