Skip to content

Commit

Permalink
Add service global test
Browse files Browse the repository at this point in the history
  • Loading branch information
tusbar committed Dec 3, 2018
1 parent 9ccde99 commit f706d30
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
30 changes: 30 additions & 0 deletions __tests__/lib/metadata/iso/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`lib.metadata.iso.index convert() extract featureTypes from a service metadata 1`] = `
Object {
"alternateTitle": undefined,
"contacts": Array [],
"description": undefined,
"featureTypes": Array [
Object {
"relatedTo": "7bcc8a8723759135feb7040380a2f2d7c921280f",
"serviceURL": "https://example.com/wfs",
"typeName": "bati_avap_paimpol",
},
Object {
"relatedTo": "46a8d50322e881fd4e8b7abc3bc45c38a247532e",
"serviceURL": "https://example.com/wfs",
"typeName": "elr_avap_paimpol",
},
],
"id": undefined,
"keywords": Array [],
"metadataType": "ISO 19139",
"resourceId": undefined,
"serviceProtocol": "wfs",
"serviceType": "download",
"serviceURL": "https://example.com/wfs",
"title": undefined,
"type": "service",
}
`;
53 changes: 53 additions & 0 deletions __tests__/lib/metadata/iso/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const {convert} = require('../../../../lib/metadata/iso')

describe('lib.metadata.iso.index', () => {
describe('convert()', () => {
it('extract featureTypes from a service metadata', () => {
expect(convert({
hierarchyLevel: 'service',
identificationInfo: {
serviceType: 'download',
coupledResource: [
{
operationName: 'GetCapabilities',
identifier: '9fd801e3-976a-49b6-b84a-0bd448fec8d5',
scopedName: 'bati_avap_paimpol'
},
{
operationName: 'DescribeFeatureType',
identifier: '9fd801e3-976a-49b6-b84a-0bd448fec8d5',
scopedName: 'bati_avap_paimpol'
},
{
operationName: 'GetFeature',
identifier: '9fd801e3-976a-49b6-b84a-0bd448fec8d5',
scopedName: 'bati_avap_paimpol'
},
{
operationName: 'GetCapabilities',
identifier: 'e3b34f32-8081-4451-83e0-4d5fcfd36512',
scopedName: 'elr_avap_paimpol'
},
{
operationName: 'DescribeFeatureType',
identifier: 'e3b34f32-8081-4451-83e0-4d5fcfd36512',
scopedName: 'elr_avap_paimpol'
}
]
},
distributionInfo: {
transferOptions: [
{
onLine: [
{
linkage: 'https://example.com/wfs?SERVICE=WFS&REQUEST=GetCapabilities&',
protocol: 'OGC:WFS-2.0.0-http-get-capabilities'
}
]
}
]
}
})).toMatchSnapshot()
})
})
})

0 comments on commit f706d30

Please sign in to comment.