mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Fix Darwin Core export filename tests
This commit is contained in:
@@ -42,7 +42,7 @@ describe('DwC-A locality export (admin-only)', () => {
|
|||||||
|
|
||||||
expect(result.status).toEqual(200)
|
expect(result.status).toEqual(200)
|
||||||
expect(result.headers['content-type']).toMatch(/application\/zip/i)
|
expect(result.headers['content-type']).toMatch(/application\/zip/i)
|
||||||
expect(result.headers['content-disposition']).toMatch(/attachment;\s*filename="now_dwc_localities_test_export_/i)
|
expect(result.headers['content-disposition']).toMatch(/attachment;\s*filename="now_dwc_localities_export_/i)
|
||||||
|
|
||||||
const zip = await JSZip.loadAsync(result.body as unknown as Buffer)
|
const zip = await JSZip.loadAsync(result.body as unknown as Buffer)
|
||||||
expect(zip.file('location.csv')).toBeTruthy()
|
expect(zip.file('location.csv')).toBeTruthy()
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ describe('DwC-A occurrence export (admin-only)', () => {
|
|||||||
|
|
||||||
expect(result.status).toEqual(200)
|
expect(result.status).toEqual(200)
|
||||||
expect(result.headers['content-type']).toMatch(/application\/zip/i)
|
expect(result.headers['content-type']).toMatch(/application\/zip/i)
|
||||||
expect(result.headers['content-disposition']).toMatch(/attachment;\s*filename="now_dwc_occurrences_test_export_/i)
|
expect(result.headers['content-disposition']).toMatch(/attachment;\s*filename="now_dwc_occurrences_export_/i)
|
||||||
|
|
||||||
const zip = await JSZip.loadAsync(result.body as unknown as Buffer)
|
const zip = await JSZip.loadAsync(result.body as unknown as Buffer)
|
||||||
expect(zip.file('location.csv')).toBeTruthy()
|
expect(zip.file('location.csv')).toBeTruthy()
|
||||||
@@ -80,7 +80,7 @@ describe('DwC-A occurrence export (admin-only)', () => {
|
|||||||
|
|
||||||
expect(result.status).toEqual(200)
|
expect(result.status).toEqual(200)
|
||||||
expect(result.headers['content-type']).toMatch(/application\/zip/i)
|
expect(result.headers['content-type']).toMatch(/application\/zip/i)
|
||||||
expect(result.headers['content-disposition']).toMatch(/attachment;\s*filename="now_dwc_dp_test_export_/i)
|
expect(result.headers['content-disposition']).toMatch(/attachment;\s*filename="now_dwc_dp_export_/i)
|
||||||
|
|
||||||
const zip = await JSZip.loadAsync(result.body as unknown as Buffer)
|
const zip = await JSZip.loadAsync(result.body as unknown as Buffer)
|
||||||
expect(zip.file('datapackage.json')).toBeTruthy()
|
expect(zip.file('datapackage.json')).toBeTruthy()
|
||||||
@@ -110,7 +110,7 @@ describe('DwC-A occurrence export (admin-only)', () => {
|
|||||||
|
|
||||||
expect(result.status).toEqual(200)
|
expect(result.status).toEqual(200)
|
||||||
expect(result.headers['content-type']).toMatch(/application\/zip/i)
|
expect(result.headers['content-type']).toMatch(/application\/zip/i)
|
||||||
expect(result.headers['content-disposition']).toMatch(/attachment;\s*filename="now_dwc_full_test_export_/i)
|
expect(result.headers['content-disposition']).toMatch(/attachment;\s*filename="now_dwc_full_export_/i)
|
||||||
|
|
||||||
const zip = await JSZip.loadAsync(result.body as unknown as Buffer)
|
const zip = await JSZip.loadAsync(result.body as unknown as Buffer)
|
||||||
expect(zip.file('README.txt')).toBeTruthy()
|
expect(zip.file('README.txt')).toBeTruthy()
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ describe('DwC-A species export (admin-only)', () => {
|
|||||||
|
|
||||||
expect(result.status).toEqual(200)
|
expect(result.status).toEqual(200)
|
||||||
expect(result.headers['content-type']).toMatch(/application\/zip/i)
|
expect(result.headers['content-type']).toMatch(/application\/zip/i)
|
||||||
expect(result.headers['content-disposition']).toMatch(/attachment;\s*filename="now_dwc_test_export_/i)
|
expect(result.headers['content-disposition']).toMatch(/attachment;\s*filename="now_dwc_export_/i)
|
||||||
|
|
||||||
const zip = await JSZip.loadAsync(result.body as unknown as Buffer)
|
const zip = await JSZip.loadAsync(result.body as unknown as Buffer)
|
||||||
expect(zip.file('taxon.csv')).toBeTruthy()
|
expect(zip.file('taxon.csv')).toBeTruthy()
|
||||||
|
|||||||
@@ -1291,29 +1291,29 @@ export const buildLocalityEmlXml = (publicationDateIso: string): string => {
|
|||||||
<eml:eml
|
<eml:eml
|
||||||
xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
|
xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
packageId="nowdatabase-dwc-locality-test-export"
|
packageId="nowdatabase-dwc-locality-export"
|
||||||
system="nowdatabase"
|
system="nowdatabase"
|
||||||
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1 https://eml.ecoinformatics.org/eml-2.1.1/eml.xsd"
|
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1 https://eml.ecoinformatics.org/eml-2.1.1/eml.xsd"
|
||||||
>
|
>
|
||||||
<!-- TODO(#1150): Replace placeholder metadata with real dataset-level EML generation. -->
|
<!-- TODO(#1150): Replace placeholder metadata with real dataset-level EML generation. -->
|
||||||
<dataset>
|
<dataset>
|
||||||
<title>NOW database Darwin Core test export (localities)</title>
|
<title>NOW database Darwin Core export (localities)</title>
|
||||||
<creator>
|
<creator>
|
||||||
<individualName>
|
<individualName>
|
||||||
<surName>NOW database</surName>
|
<surName>The NOW Community</surName>
|
||||||
</individualName>
|
</individualName>
|
||||||
</creator>
|
</creator>
|
||||||
<contact>
|
<contact>
|
||||||
<individualName>
|
<individualName>
|
||||||
<surName>NOW database</surName>
|
<surName>The NOW Community</surName>
|
||||||
</individualName>
|
</individualName>
|
||||||
</contact>
|
</contact>
|
||||||
<pubDate>${publicationDateIso}</pubDate>
|
<pubDate>${publicationDateIso}</pubDate>
|
||||||
<abstract>
|
<abstract>
|
||||||
<para>Admin-only test Darwin Core Archive export for localities, mapping Location + GeologicalContext + MeasurementOrFact terms. Field mappings are intentionally limited for v1.</para>
|
<para>Production Darwin Core Archive export for NOW locality records, mapping Location, GeologicalContext, and MeasurementOrFact terms. Field mappings are intentionally limited for v1.</para>
|
||||||
</abstract>
|
</abstract>
|
||||||
<intellectualRights>
|
<intellectualRights>
|
||||||
<para>TODO(#1150): Add rights / license information.</para>
|
<para>This dataset is made available under the Creative Commons Attribution 4.0 International License (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/.</para>
|
||||||
</intellectualRights>
|
</intellectualRights>
|
||||||
</dataset>
|
</dataset>
|
||||||
</eml:eml>
|
</eml:eml>
|
||||||
|
|||||||
@@ -514,29 +514,29 @@ export const buildOccurrenceEmlXml = (publicationDateIso: string): string => {
|
|||||||
<eml:eml
|
<eml:eml
|
||||||
xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
|
xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
packageId="nowdatabase-dwc-occurrence-test-export"
|
packageId="nowdatabase-dwc-occurrence-export"
|
||||||
system="nowdatabase"
|
system="nowdatabase"
|
||||||
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1 https://eml.ecoinformatics.org/eml-2.1.1/eml.xsd"
|
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1 https://eml.ecoinformatics.org/eml-2.1.1/eml.xsd"
|
||||||
>
|
>
|
||||||
<!-- TODO(#1150): Replace placeholder metadata with real dataset-level EML generation. -->
|
<!-- TODO(#1150): Replace placeholder metadata with real dataset-level EML generation. -->
|
||||||
<dataset>
|
<dataset>
|
||||||
<title>NOW database Darwin Core test export (occurrences)</title>
|
<title>NOW database Darwin Core export (occurrences)</title>
|
||||||
<creator>
|
<creator>
|
||||||
<individualName>
|
<individualName>
|
||||||
<surName>NOW database</surName>
|
<surName>The NOW Community</surName>
|
||||||
</individualName>
|
</individualName>
|
||||||
</creator>
|
</creator>
|
||||||
<contact>
|
<contact>
|
||||||
<individualName>
|
<individualName>
|
||||||
<surName>NOW database</surName>
|
<surName>The NOW Community</surName>
|
||||||
</individualName>
|
</individualName>
|
||||||
</contact>
|
</contact>
|
||||||
<pubDate>${publicationDateIso}</pubDate>
|
<pubDate>${publicationDateIso}</pubDate>
|
||||||
<abstract>
|
<abstract>
|
||||||
<para>Admin-only test Darwin Core Archive export for occurrence records from now_ls. Location and taxon lookup files are included with the same structures as the locality and taxon exports.</para>
|
<para>Production Darwin Core Archive export for occurrence records from the NOW database. Location and taxon lookup files are included with the same structures as the locality and taxon exports.</para>
|
||||||
</abstract>
|
</abstract>
|
||||||
<intellectualRights>
|
<intellectualRights>
|
||||||
<para>TODO(#1150): Add rights / license information.</para>
|
<para>This dataset is made available under the Creative Commons Attribution 4.0 International License (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/.</para>
|
||||||
</intellectualRights>
|
</intellectualRights>
|
||||||
</dataset>
|
</dataset>
|
||||||
</eml:eml>
|
</eml:eml>
|
||||||
|
|||||||
Reference in New Issue
Block a user