Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/feature/11-extended-filt…
Browse files Browse the repository at this point in the history
…er-capabilities' into dev
  • Loading branch information
p-a-s-c-a-l committed May 18, 2020
2 parents 54f1133 + e3ae35e commit 8965fbd
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 69 deletions.
44 changes: 33 additions & 11 deletions dist/index.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.es.js.map

Large diffs are not rendered by default.

44 changes: 33 additions & 11 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "csis-helpers-js",
"version": "0.5.4",
"version": "0.6.0",
"description": "CLARITY CSIS JavaScript Helpers Module",
"author": "p-a-s-c-a-l",
"license": "MIT",
Expand Down
29 changes: 22 additions & 7 deletions src/__tests__/CSISHelpers.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import axios from 'axios';
/*
* ***************************************************
*
* cismet GmbH, Saarbruecken, Germany
*
* ... and it just works.
*
* ***************************************************
*/

import axios from 'axios';
import log from 'loglevel';

// Using ie9 polyfills as the "kitchen sink" of polyfills
// https://github.com/clarity-h2020/csis-helpers-js/issues/12
import 'react-app-polyfill/ie9';
import 'react-app-polyfill/stable';

// DON't use this. It imports just the default export which is the CSISHelpers class.
// import CSISHelpers from './../lib/CSISHelpers.js';
import * as CSISHelpers from './../lib/CSISHelpers.js';
Expand Down Expand Up @@ -106,7 +121,7 @@ test('[DEV] find resources with @mapview:ogc:wms references in resource array',
const referenceType = '@mapview:ogc:wms';
const resourcesArray = apiResponseResources.data;
const includedArray = apiResponseResources.included;
const filteredResources = CSISHelpers.filterResourcesbyReferenceType(resourcesArray, includedArray, referenceType);
const filteredResources = CSISHelpers.filterResourcesByReferenceType(resourcesArray, includedArray, referenceType);
expect(filteredResources.length).toBeLessThan(resourcesArray.length);
expect(filteredResources).toHaveLength(102);
});
Expand All @@ -115,7 +130,7 @@ test('[RELEASE] find resources with @mapview:ogc:wms references in resource arra
const referenceType = '@mapview:ogc:wms';
const resourcesArray = apiResponseResources.data;
const includedArray = apiResponseResources.included;
const filteredResources = _CSISHelpers.filterResourcesbyReferenceType(resourcesArray, includedArray, referenceType);
const filteredResources = _CSISHelpers.filterResourcesByReferenceType(resourcesArray, includedArray, referenceType);
expect(filteredResources.length).toBeLessThan(resourcesArray.length);
expect(filteredResources).toHaveLength(102);
});
Expand Down Expand Up @@ -153,7 +168,7 @@ test('[RELEASE] find resources with @mapview:ogc:wms references in resource arra
const referenceType = '@mapview:ogc:wms';
const resourcesArray = apiResponseResources.data;
const includedArray = apiResponseResources.included;
const filteredResources = _CSISHelpers.filterResourcesbyReferenceType(resourcesArray, includedArray, referenceType);
const filteredResources = _CSISHelpers.filterResourcesByReferenceType(resourcesArray, includedArray, referenceType);
expect(filteredResources.length).toBeLessThan(resourcesArray.length);
expect(filteredResources).toHaveLength(102);
});
Expand All @@ -165,7 +180,7 @@ test('find HC resources with @mapview:ogc:wms references in resource array', ()
const resourcesArray = apiResponseResources.data;
const includedArray = apiResponseResources.included;

const filteredResources = CSISHelpers.filterResourcesbyReferenceType(
const filteredResources = CSISHelpers.filterResourcesByReferenceType(
CSISHelpers.filterResourcesbyTagName(resourcesArray, includedArray, tagType, tagName),
includedArray,
referenceType
Expand All @@ -181,14 +196,14 @@ test('get 1st "reference" for first HC resource with @mapview:ogc:wms references
const resourcesArray = apiResponseResources.data;
const includedArray = apiResponseResources.included;

const filteredResources = CSISHelpers.filterResourcesbyReferenceType(
const filteredResources = CSISHelpers.filterResourcesByReferenceType(
CSISHelpers.filterResourcesbyTagName(resourcesArray, includedArray, tagType, tagName),
includedArray,
referenceType
);
expect(filteredResources).not.toBeNull();
expect(filteredResources.length).toBeGreaterThan(0);
const reference = CSISHelpers.extractReferencesfromResource(filteredResources[0], includedArray, referenceType);
const reference = CSISHelpers.extractReferencesFromResource(filteredResources[0], includedArray, referenceType);
expect(reference).not.toBeNull();
expect(reference.length).toBeGreaterThan(0);

Expand Down
17 changes: 16 additions & 1 deletion src/__tests__/CSISRemoteHelpers.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import axios from 'axios';
/*
* ***************************************************
*
* cismet GmbH, Saarbruecken, Germany
*
* ... and it just works.
*
* ***************************************************
*/

import axios from 'axios';
import log from 'loglevel';

// Using ie9 polyfills as the "kitchen sink" of polyfills
// https://github.com/clarity-h2020/csis-helpers-js/issues/12
import 'react-app-polyfill/ie9';
import 'react-app-polyfill/stable';

import * as CSISRemoteHelpers from './../lib/CSISRemoteHelpers.js';
import * as CSISHelpers from './../lib/CSISHelpers.js';

Expand Down
15 changes: 15 additions & 0 deletions src/__tests__/CSISResource.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* ***************************************************
*
* cismet GmbH, Saarbruecken, Germany
*
* ... and it just works.
*
* ***************************************************
*/

// Using ie9 polyfills as the "kitchen sink" of polyfills
// https://github.com/clarity-h2020/csis-helpers-js/issues/12
import 'react-app-polyfill/ie9';
import 'react-app-polyfill/stable';

import CSISResource from './../classes/CSISResource';
import { CSISResource as _CSISResource } from './../../dist/index.js';

Expand Down
5 changes: 5 additions & 0 deletions src/__tests__/EMIKATHelpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

import axios from 'axios';

// Using ie9 polyfills as the "kitchen sink" of polyfills
// https://github.com/clarity-h2020/csis-helpers-js/issues/12
import 'react-app-polyfill/ie9';
import 'react-app-polyfill/stable';

import * as EMIKATHelpers from './../lib/EMIKATHelpers.js';
import { EMIKATHelpers as _EMIKATHelpers } from './../../dist/index.js';

Expand Down
3 changes: 1 addition & 2 deletions src/classes/CSISResource.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* ***************************************************
*
Expand Down Expand Up @@ -46,7 +45,7 @@ export default class CSISResource {
* @returns {Object{[]}
*/
getReferences(referenceType) {
return CSISHelpers.extractReferencesfromResource(this.resource, this.includes, referenceType);
return CSISHelpers.extractReferencesFromResource(this.resource, this.includes, referenceType);
}

/**
Expand Down
Loading

0 comments on commit 8965fbd

Please sign in to comment.