Skip to content

Commit

Permalink
Add doi property to ExternalVersionSummary type [elifesciences/enhanc…
Browse files Browse the repository at this point in the history
  • Loading branch information
nlisgo committed Jul 9, 2024
1 parent 8d4eb68 commit abe62e5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/types/enhanced-article.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ export type PreprintVersionSummary = {
};

export type ExternalVersionSummary = {
doi: string,
versionIdentifier: string,
published: Date | null,
url: string,
corrections?: {
date: Date,
url: string,
}[]
}[],
};

export type VersionSummary = PreprintVersionSummary | ExternalVersionSummary;
Expand Down
1 change: 1 addition & 0 deletions src/utils/generators/generate-timeline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const version2: EnhancedArticle = {
};

const version3Summary: VersionSummary = {
doi: 'doi-123v3',
versionIdentifier: '3',
published: new Date('2023-02-09'),
url: 'https://doi.org/doi-123v3',
Expand Down
2 changes: 2 additions & 0 deletions src/utils/generators/generate-version-history.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ const version2: EnhancedArticle = {
};

const version3Summary: VersionSummary = {
doi: 'doi-123v3',
versionIdentifier: '3',
published: new Date('2023-02-09'),
url: 'https://doi.org/doi-123v3',
};

const version3SummaryWithCorrections: VersionSummary = {
doi: 'doi-123v3',
versionIdentifier: '3',
published: new Date('2023-02-09'),
url: 'https://doi.org/doi-123v3',
Expand Down
1 change: 1 addition & 0 deletions src/utils/mocks/enhanced-article-with-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const mock85111: EnhancedArticleWithVersions = {
versionIdentifier: '2',
},
'85111v3': {
doi: '10.7554/eLife.85111.3',
versionIdentifier: '3',
published: new Date('2023-06-07T00:00:00.000Z'),
url: 'https://elifesciences.org/articles/85111v1',
Expand Down
1 change: 1 addition & 0 deletions src/utils/type-guards.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { isExternalVersionSummary, isPreprintVersionSummary } from './type-guards';

const externalVersionSummary = {
doi: '10.7554/eLife.85111.3',
versionIdentifier: '3',
published: new Date('2023-06-07T00:00:00.000Z'),
url: 'https://elifesciences.org/articles/85111v1',
Expand Down
1 change: 1 addition & 0 deletions wiremock/files/preprints/85111v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -9360,6 +9360,7 @@
"volume": "12"
},
"85111v3": {
"doi": "10.7554/eLife.85111.3",
"versionIdentifier": "3",
"published": "2023-06-07T00:00:00.000Z",
"url": "https://elifesciences.org/articles/85111v1",
Expand Down
1 change: 1 addition & 0 deletions wiremock/files/preprints/85111v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -10100,6 +10100,7 @@
"volume": "12"
},
"85111v3": {
"doi": "10.7554/eLife.85111.3",
"versionIdentifier": "3",
"published": "2023-06-07T00:00:00.000Z",
"url": "https://elifesciences.org/articles/85111v1",
Expand Down

0 comments on commit abe62e5

Please sign in to comment.