Skip to content

Commit

Permalink
refactor: tests naming
Browse files Browse the repository at this point in the history
  • Loading branch information
lihbr committed Sep 16, 2024
1 parent 51db286 commit 397b04c
Show file tree
Hide file tree
Showing 14 changed files with 2,632 additions and 1,712 deletions.
8 changes: 8 additions & 0 deletions src/Migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,14 @@ export class Migration<TDocuments extends PrismicDocument = PrismicDocument> {
)
}

/**
* Migrates a Prismic document data from another repository so that it can be
* created through the current repository's Migration API.
*
* @param input - The Prismic document data to migrate.
*
* @returns The migrated Prismic document data.
*/
#migratePrismicDocumentData(input: unknown): unknown {
if (is.filledContentRelationship(input)) {
if (input.isBroken) {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/resolveMigrationDocumentData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export async function resolveMigrationContentRelationship(

if (relation instanceof PrismicMigrationDocument) {
return relation.document.id
? { link_type: "Document", id: relation.document.id }
: { link_type: "Document" }
? { link_type: LinkType.Document, id: relation.document.id }
: { link_type: LinkType.Document }
}

if (relation) {
Expand All @@ -54,10 +54,10 @@ export async function resolveMigrationContentRelationship(
}
}

return { link_type: "Document", id: relation.id }
return { link_type: LinkType.Document, id: relation.id }
}

return { link_type: "Document" }
return { link_type: LinkType.Document }
}

/**
Expand Down
Loading

0 comments on commit 397b04c

Please sign in to comment.