-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(unit-tests): implemented and integrated (#37)
* feat(unit-tests): implemented and integrated * fix(pr-comments): fixed
- Loading branch information
Showing
6 changed files
with
80 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Test | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
lint: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Unit/Integration tests | ||
run: npm run test |
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 |
---|---|---|
|
@@ -127,3 +127,6 @@ dist | |
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
# reports of jest tests | ||
reports |
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,2 +1,5 @@ | ||
export * from './layerMetadata'; | ||
export * from './layerMetadata-StatusFields'; | ||
|
||
export { IShpMapping } from './decorators/shp.decorator'; | ||
export { IPYCSWMapping } from './decorators/csw.decorator'; |
File renamed without changes.
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,51 @@ | ||
import { LayerMetadata, IPYCSWMapping, IShpMapping, IPropPYCSWMapping, IPropSHPMapping } from '../../src/models'; | ||
|
||
describe('LayerMetadata class static methods', () => { | ||
it('getPyCSWMapping(): mapped to PYCSW prop', () => { | ||
const PROPERTY_NAME = 'geometry'; | ||
const pycswMapping: IPYCSWMapping | undefined = LayerMetadata.getPyCSWMapping(PROPERTY_NAME); | ||
|
||
expect(pycswMapping).toHaveProperty('xmlElement'); | ||
expect(pycswMapping).toHaveProperty('queryableField'); | ||
}); | ||
|
||
it('getPyCSWMapping(): NOT mapped to PYCSW prop', () => { | ||
const PROPERTY_NAME = 'dummy_geometry'; | ||
const pycswMapping: IPYCSWMapping | undefined = LayerMetadata.getPyCSWMapping(PROPERTY_NAME); | ||
|
||
expect(pycswMapping).toBeUndefined(); | ||
}); | ||
|
||
it('getShpMapping(): mapped to SHAPE prop', () => { | ||
const PROPERTY_NAME = 'geometry'; | ||
const shpMapping: IShpMapping | undefined = LayerMetadata.getShpMapping(PROPERTY_NAME); | ||
|
||
expect(shpMapping).toHaveProperty('shpFile'); | ||
expect(shpMapping).toHaveProperty('valuePath'); | ||
}); | ||
|
||
it('getShpMapping(): NOT mapped to SHAPE prop', () => { | ||
const PROPERTY_NAME = 'dummy_geometry'; | ||
const shpMapping: IShpMapping | undefined = LayerMetadata.getShpMapping(PROPERTY_NAME); | ||
|
||
expect(shpMapping).toBeUndefined(); | ||
}); | ||
|
||
it('getPyCSWMappings(): HAS props mapped to PYCSW', () => { | ||
const pycswMappings: IPropPYCSWMapping[] = LayerMetadata.getPyCSWMappings(); | ||
|
||
expect(pycswMappings.length).toBeGreaterThan(0); | ||
expect(pycswMappings[0]).toHaveProperty('prop'); | ||
expect(pycswMappings[0]).toHaveProperty('xmlElement'); | ||
expect(pycswMappings[0]).toHaveProperty('queryableField'); | ||
}); | ||
|
||
it('getShpMappings(): HAS props mapped to SHAPE', () => { | ||
const shpMappings: IPropSHPMapping[] = LayerMetadata.getShpMappings(); | ||
|
||
expect(shpMappings.length).toBeGreaterThan(0); | ||
expect(shpMappings[0]).toHaveProperty('prop'); | ||
expect(shpMappings[0]).toHaveProperty('shpFile'); | ||
expect(shpMappings[0]).toHaveProperty('valuePath'); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.