Skip to content

Commit

Permalink
fix(example): fix example Gpx 3d and functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
ftoromanoff committed Sep 13, 2023
1 parent 363f137 commit aeb6c08
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions examples/source_file_gpx_3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,18 @@
out: {
crs: view.referenceCrs,
structure: '3d',
style: {
style: new itowns.Style({
stroke : {
color: 'red',
width: 2,
},
point : {
color: 'white',
}
}
}),
}
}))
.then(itowns.Feature2Mesh.convert({style}))
.then(itowns.Feature2Mesh.convert())
.then(function (mesh) {
if (mesh) {
mesh.updateMatrixWorld();
Expand Down
12 changes: 11 additions & 1 deletion test/functional/source_file_gpx_3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ describe('source_file_gpx_3d', function _() {
result = await loadExample('examples/source_file_gpx_3d.html', this.fullTitle());
});

it('should run', async () => {
it('view initialized', async () => {
assert.ok(result);
});

it('should wait for the mesh to be added to the scene', async () => {
await page.waitForFunction(() => view.scene.children.length === 5);

const nbChildren = await page.evaluate(() => {
console.log();
return view.scene.children.length;
});
assert.equal(nbChildren, 5);
});
});

0 comments on commit aeb6c08

Please sign in to comment.