Fix Darwin Core export filename tests

This commit is contained in:
karilint
2026-06-11 17:54:50 +03:00
parent 24d4248272
commit 7c4199d819
5 changed files with 17 additions and 17 deletions
@@ -42,7 +42,7 @@ describe('DwC-A locality export (admin-only)', () => {
expect(result.status).toEqual(200)
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)
expect(zip.file('location.csv')).toBeTruthy()
@@ -42,7 +42,7 @@ describe('DwC-A occurrence export (admin-only)', () => {
expect(result.status).toEqual(200)
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)
expect(zip.file('location.csv')).toBeTruthy()
@@ -80,7 +80,7 @@ describe('DwC-A occurrence export (admin-only)', () => {
expect(result.status).toEqual(200)
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)
expect(zip.file('datapackage.json')).toBeTruthy()
@@ -110,7 +110,7 @@ describe('DwC-A occurrence export (admin-only)', () => {
expect(result.status).toEqual(200)
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)
expect(zip.file('README.txt')).toBeTruthy()
@@ -42,7 +42,7 @@ describe('DwC-A species export (admin-only)', () => {
expect(result.status).toEqual(200)
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)
expect(zip.file('taxon.csv')).toBeTruthy()
@@ -1291,29 +1291,29 @@ export const buildLocalityEmlXml = (publicationDateIso: string): string => {
<eml:eml
xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
packageId="nowdatabase-dwc-locality-test-export"
packageId="nowdatabase-dwc-locality-export"
system="nowdatabase"
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. -->
<dataset>
<title>NOW database Darwin Core test export (localities)</title>
<title>NOW database Darwin Core export (localities)</title>
<creator>
<individualName>
<surName>NOW database</surName>
<surName>The NOW Community</surName>
</individualName>
</creator>
<contact>
<individualName>
<surName>NOW database</surName>
<surName>The NOW Community</surName>
</individualName>
</contact>
<pubDate>${publicationDateIso}</pubDate>
<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>
<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>
</dataset>
</eml:eml>
@@ -514,29 +514,29 @@ export const buildOccurrenceEmlXml = (publicationDateIso: string): string => {
<eml:eml
xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
packageId="nowdatabase-dwc-occurrence-test-export"
packageId="nowdatabase-dwc-occurrence-export"
system="nowdatabase"
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. -->
<dataset>
<title>NOW database Darwin Core test export (occurrences)</title>
<title>NOW database Darwin Core export (occurrences)</title>
<creator>
<individualName>
<surName>NOW database</surName>
<surName>The NOW Community</surName>
</individualName>
</creator>
<contact>
<individualName>
<surName>NOW database</surName>
<surName>The NOW Community</surName>
</individualName>
</contact>
<pubDate>${publicationDateIso}</pubDate>
<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>
<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>
</dataset>
</eml:eml>