Skip to content

Commit

Permalink
fix(test): replace deprecated parsedData by features.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux committed Oct 1, 2020
1 parent 4cd963d commit 096e678
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/unit/dataSourceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ describe('Provide in Sources', function () {
featureLayer.source.uid = 8;
featureLayer.parsingOptions.mergeFeatures = true;
featureLayer.cache.data.clear();
featureLayer.source._parsedDatasCaches = {};
featureLayer.source._featuresCaches = {};
featureLayer.source.onLayerAdded({ crsOut: featureLayer.crs });
featureLayer.update(context, featureLayer, tile);
DataSourceProvider.executeCommand(context.scheduler.commands[0]).then((features) => {
Expand Down
14 changes: 7 additions & 7 deletions test/unit/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ describe('Sources', function () {
assert.ok(source.extentsInsideLimit([extent, extent]));
assert.ok(source.fetchedData);
assert.ok(source.fetchedData);
assert.ok(!source.parsedData);
assert.ok(!source.features);
assert.ok(source.isFileSource);
fetchedData = source.fetchedData;
assert.equal(fetchedData.properties.nom, 'Ariège');
Expand All @@ -244,7 +244,7 @@ describe('Sources', function () {
crs: 'EPSG:4326',
});

assert.ok(!source.parsedData);
assert.ok(!source.features);
assert.equal(source.urlFromExtent(), 'fake-file-url');
assert.ok(source.fetchedData);
assert.ok(source.isFileSource);
Expand All @@ -264,9 +264,9 @@ describe('Sources', function () {
layer._resolve();
});

it('should instance and use FileSource with parsedData', function () {
it('should instance and use FileSource with features', function () {
const source = new FileSource({
parsedData: { foo: 'bar', crs: 'EPSG:4326' },
features: { foo: 'bar', crs: 'EPSG:4326' },
crs: 'EPSG:4326',
});
source.onLayerAdded({ crsOut: source.crs });
Expand All @@ -282,17 +282,17 @@ describe('Sources', function () {
assert.throws(() => new FileSource({ crs: 'EPSG:4326' }), Error);
});

describe('should set the crs projection from parsedData', function () {
describe('should set the crs projection from features', function () {
it('with the crs', function () {
const source = new FileSource({
parsedData: { crs: 'EPSG:4326' },
features: { crs: 'EPSG:4326' },
});
assert.strictEqual(source.crs, 'EPSG:4326');
});

it('with the crs projection', function () {
const source = new FileSource({
parsedData: { crs: 'EPSG:4326' },
features: { crs: 'EPSG:4326' },
});
assert.strictEqual(source.crs, 'EPSG:4326');
});
Expand Down
2 changes: 1 addition & 1 deletion test/unit/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Viewer', function () {

globelayer = new GlobeLayer('globe', new THREE.Group());
source = new FileSource({
parsedData: { crs: 'EPSG:4326' },
features: { crs: 'EPSG:4326' },
crs: 'EPSG:4326',
});

Expand Down

0 comments on commit 096e678

Please sign in to comment.