-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(comments): omit inline comments without referenced value
- Loading branch information
1 parent
61b2dbc
commit 1f9a592
Showing
3 changed files
with
155 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/sanity/src/structure/comments/src/__tests__/helpers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {type CommentDocument, type CommentPath} from '../types' | ||
|
||
interface BuildTestCommentProps { | ||
path: CommentPath | ||
} | ||
|
||
export function buildTestComment(props: BuildTestCommentProps): CommentDocument { | ||
const {path} = props | ||
|
||
return { | ||
_createdAt: '', | ||
_id: '', | ||
_rev: '', | ||
_type: 'comment', | ||
authorId: '', | ||
message: [], | ||
reactions: [], | ||
status: 'open', | ||
threadId: '', | ||
target: { | ||
document: { | ||
_dataset: '', | ||
_projectId: '', | ||
_ref: '', | ||
_type: 'crossDatasetReference', | ||
_weak: true, | ||
}, | ||
documentType: '', | ||
path, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters