Skip to content

Commit 2d308c7

Browse files
committed
fix: mock types
1 parent b629f1b commit 2d308c7

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

test/unit/transform/transform-space.test.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import { cloneDeep } from 'lodash'
22

3-
import {
4-
contentTypeMock,
5-
entryMock,
6-
assetMock,
7-
localeMock,
8-
webhookMock
9-
} from 'contentful-batch-libs/test/mocks/'
3+
import { assetMock, contentTypeMock, entryMock, localeMock, webhookMock } from 'contentful-batch-libs/test/mocks/'
104

115
import transformSpace from '../../../lib/transform/transform-space'
126
import { Resources, TransformedSourceData } from '../../../lib/types'
137
import { TagSysProps } from 'contentful-management/dist/typings/entities/tag'
14-
import type { AssetProps, LocaleProps, WebhookProps } from 'contentful-management'
8+
import type { AssetProps, ContentTypeProps, EntryProps, LocaleProps, WebhookProps } from 'contentful-management'
159

1610
const tagMock = {
1711
sys: ({
@@ -21,19 +15,19 @@ const tagMock = {
2115
}
2216

2317
type ResourcesWithDoNotTouch = Resources & {
24-
doNotTouch?: boolean;
18+
doNotTouch?: boolean;
2519
}
2620

2721
type TransformedSourceDataWithDoNotTouch = TransformedSourceData & {
28-
doNotTouch?: boolean;
22+
doNotTouch?: boolean;
2923
}
3024

3125
const space: ResourcesWithDoNotTouch = {
32-
contentTypes: [contentTypeMock],
33-
entries: [entryMock],
26+
contentTypes: [contentTypeMock as unknown as ContentTypeProps],
27+
entries: [entryMock as unknown as EntryProps],
3428
assets: [assetMock as unknown as AssetProps],
35-
locales: [localeMock as LocaleProps],
36-
webhooks: [webhookMock as WebhookProps],
29+
locales: [localeMock as unknown as LocaleProps],
30+
webhooks: [webhookMock as unknown as WebhookProps],
3731
tags: [tagMock]
3832
}
3933
const destinationSpace = cloneDeep(space)

0 commit comments

Comments
 (0)