Skip to content

Commit

Permalink
fix hard-coded year in test data
Browse files Browse the repository at this point in the history
  • Loading branch information
ekraffmiller committed Jan 5, 2024
1 parent f229fdf commit b59d4e2
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ function getCurrentDateInYYYYMMDDFormat() {

const datasetData = (persistentId: string, versionId: number) => {
const persistentIdUrl = `https://doi.org/${persistentId.replace('doi:', '')}`
const year = new Date().getFullYear()
return {
citation: `Finch, Fiona, 2023, "Darwin's Finches", <a href="${persistentIdUrl}" target="_blank">${persistentIdUrl}</a>, Root, DRAFT VERSION`,
citation: `Finch, Fiona, ${year}, "Darwin's Finches", <a href="${persistentIdUrl}" target="_blank">${persistentIdUrl}</a>, Root, DRAFT VERSION`,
labels: [
{ semanticMeaning: 'dataset', value: 'Draft' },
{ semanticMeaning: 'warning', value: 'Unpublished' }
Expand Down Expand Up @@ -263,6 +264,12 @@ describe('Dataset JSDataverse Repository', () => {
expect(dataset.metadataBlocks[0].fields.citationDate).not.to.exist
})
})
it.only('gets the total dataset count', async () => {
const datasetResponse = await DatasetHelper.create()

Check warning on line 268 in tests/e2e-integration/integration/datasets/DatasetJSDataverseRepository.spec.ts

View workflow job for this annotation

GitHub Actions / lint

'datasetResponse' is assigned a value but never used. Allowed unused vars must match /^_/u
await datasetRepository.getTotalDatasetsCount().then((count) => {
expect(count).to.equal(1)
})
})

it.skip('gets the dataset by persistentId when the dataset is deaccessioned', async () => {
// TODO - Implement once the getDatasetCitation includes deaccessioned datasets
Expand Down

0 comments on commit b59d4e2

Please sign in to comment.