1
1
import { act , renderHook } from "@testing-library/react-hooks" ;
2
2
import React from "react" ;
3
- import mockConnection from "test-utils/mock-data/mockConnection.json " ;
4
- import mockDest from "test-utils/mock-data/mockDestinationDefinition.json " ;
5
- import mockWorkspace from "test-utils/mock-data/mockWorkspace.json " ;
3
+ import { mockConnection } from "test-utils/mock-data/mockConnection" ;
4
+ import { mockDestination } from "test-utils/mock-data/mockDestination " ;
5
+ import { mockWorkspace } from "test-utils/mock-data/mockWorkspace" ;
6
6
import { TestWrapper } from "test-utils/testutils" ;
7
7
8
- import { AirbyteCatalog , WebBackendConnectionRead } from "core/request/AirbyteClient" ;
9
8
import { FormError } from "utils/errorStatusMessage" ;
10
9
11
10
import {
@@ -15,7 +14,7 @@ import {
15
14
} from "./ConnectionFormService" ;
16
15
17
16
jest . mock ( "services/connector/DestinationDefinitionSpecificationService" , ( ) => ( {
18
- useGetDestinationDefinitionSpecification : ( ) => mockDest ,
17
+ useGetDestinationDefinitionSpecification : ( ) => mockDestination ,
19
18
} ) ) ;
20
19
21
20
jest . mock ( "services/workspaces/WorkspacesService" , ( ) => ( {
@@ -37,7 +36,7 @@ describe("ConnectionFormService", () => {
37
36
38
37
it ( "should take a partial Connection" , async ( ) => {
39
38
const partialConnection : ConnectionOrPartialConnection = {
40
- syncCatalog : mockConnection . syncCatalog as AirbyteCatalog ,
39
+ syncCatalog : mockConnection . syncCatalog ,
41
40
source : mockConnection . source ,
42
41
destination : mockConnection . destination ,
43
42
} ;
@@ -57,7 +56,7 @@ describe("ConnectionFormService", () => {
57
56
const { result } = renderHook ( useConnectionFormService , {
58
57
wrapper : Wrapper ,
59
58
initialProps : {
60
- connection : mockConnection as WebBackendConnectionRead ,
59
+ connection : mockConnection ,
61
60
mode : "create" ,
62
61
refreshSchema,
63
62
} ,
@@ -71,7 +70,7 @@ describe("ConnectionFormService", () => {
71
70
const { result } = renderHook ( useConnectionFormService , {
72
71
wrapper : Wrapper ,
73
72
initialProps : {
74
- connection : mockConnection as WebBackendConnectionRead ,
73
+ connection : mockConnection ,
75
74
mode : "create" ,
76
75
refreshSchema,
77
76
} ,
@@ -86,7 +85,7 @@ describe("ConnectionFormService", () => {
86
85
const { result } = renderHook ( useConnectionFormService , {
87
86
wrapper : Wrapper ,
88
87
initialProps : {
89
- connection : mockConnection as WebBackendConnectionRead ,
88
+ connection : mockConnection ,
90
89
mode : "create" ,
91
90
refreshSchema,
92
91
} ,
@@ -99,7 +98,7 @@ describe("ConnectionFormService", () => {
99
98
const { result } = renderHook ( useConnectionFormService , {
100
99
wrapper : Wrapper ,
101
100
initialProps : {
102
- connection : mockConnection as WebBackendConnectionRead ,
101
+ connection : mockConnection ,
103
102
mode : "create" ,
104
103
refreshSchema,
105
104
} ,
@@ -112,7 +111,7 @@ describe("ConnectionFormService", () => {
112
111
const { result } = renderHook ( useConnectionFormService , {
113
112
wrapper : Wrapper ,
114
113
initialProps : {
115
- connection : mockConnection as WebBackendConnectionRead ,
114
+ connection : mockConnection ,
116
115
mode : "create" ,
117
116
refreshSchema,
118
117
} ,
0 commit comments