Skip to content

Commit

Permalink
test(sanity): convert to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard committed Oct 4, 2022
1 parent 5608c26 commit 91dd6e1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {SanityDocument} from '@sanity/types'
import {collate, removeDupes} from '../src/util/draftUtils'

test('collate()', () => {
Expand All @@ -14,10 +15,10 @@ test('collate()', () => {
})

test('removeDupes()', () => {
const foo = {_type: 'foo', _id: 'foo'}
const fooDraft = {_type: 'foo', _id: 'drafts.foo'}
const barDraft = {_type: 'foo', _id: 'drafts.bar'}
const baz = {_type: 'foo', _id: 'baz'}
const foo = {_type: 'foo', _id: 'foo'} as SanityDocument
const fooDraft = {_type: 'foo', _id: 'drafts.foo'} as SanityDocument
const barDraft = {_type: 'foo', _id: 'drafts.bar'} as SanityDocument
const baz = {_type: 'foo', _id: 'baz'} as SanityDocument

expect(removeDupes([foo, fooDraft, barDraft, baz])).toEqual([fooDraft, barDraft, baz])
})
File renamed without changes.

0 comments on commit 91dd6e1

Please sign in to comment.