@@ -37,9 +37,7 @@ test("labelField that doesn't exist is rejected with displayMode: select", () =>
3737 } ) ,
3838 { } as any
3939 )
40- ) . toThrowErrorMatchingInlineSnapshot (
41- `"The ui.labelField option for field 'A.something' uses 'doesNotExist' but that field doesn't exist."`
42- )
40+ ) . toThrowErrorMatchingInlineSnapshot ( `""doesNotExist" is not a field of list "Thing""` )
4341} )
4442
4543test ( "labelField that doesn't exist is rejected with displayMode: cards" , ( ) => {
@@ -69,9 +67,7 @@ test("labelField that doesn't exist is rejected with displayMode: cards", () =>
6967 } ) ,
7068 { } as any
7169 )
72- ) . toThrowErrorMatchingInlineSnapshot (
73- `"The ui.inlineConnect.labelField option for field 'A.something' uses 'doesNotExist' but that field doesn't exist."`
74- )
70+ ) . toThrowErrorMatchingInlineSnapshot ( `""doesNotExist" is not a field of list "Thing""` )
7571} )
7672
7773test ( "searchFields that don't exist are rejected with displayMode: select" , ( ) => {
@@ -99,9 +95,7 @@ test("searchFields that don't exist are rejected with displayMode: select", () =
9995 } ) ,
10096 { } as any
10197 )
102- ) . toThrowErrorMatchingInlineSnapshot (
103- `"The ui.searchFields option for relationship field 'A.something' includes 'doesNotExist' but that field doesn't exist."`
104- )
98+ ) . toThrowErrorMatchingInlineSnapshot ( `""doesNotExist" is not a field of list "Thing""` )
10599} )
106100
107101test ( "searchFields that don't exist are rejected with displayMode: cards" , ( ) => {
@@ -131,69 +125,5 @@ test("searchFields that don't exist are rejected with displayMode: cards", () =>
131125 } ) ,
132126 { } as any
133127 )
134- ) . toThrowErrorMatchingInlineSnapshot (
135- `"The ui.inlineConnect.searchFields option for relationship field 'A.something' includes 'doesNotExist' but that field doesn't exist."`
136- )
137- } )
138-
139- test ( "searchFields that aren't searchable are rejected with displayMode: select" , ( ) => {
140- expect ( ( ) =>
141- getContext (
142- ( {
143- db : {
144- provider : 'sqlite' ,
145- url : 'file://'
146- } ,
147- lists : {
148- A : list ( {
149- access : allowAll ,
150- fields : {
151- something : relationship ( {
152- ref : 'Thing' ,
153- ui : {
154- searchFields : [ 'notText' ] ,
155- } ,
156- } ) ,
157- } ,
158- } ) ,
159- Thing,
160- } ,
161- } ) ,
162- { } as any
163- )
164- ) . toThrowErrorMatchingInlineSnapshot (
165- `"The ui.searchFields option for field 'A.something' includes 'notText' but that field doesn't have a contains filter that accepts a GraphQL String"`
166- )
167- } )
168-
169- test ( "searchFields that aren't searchable are rejected with displayMode: cards" , ( ) => {
170- expect ( ( ) =>
171- getContext (
172- ( {
173- db : {
174- provider : 'sqlite' ,
175- url : 'file://'
176- } ,
177- lists : {
178- A : list ( {
179- access : allowAll ,
180- fields : {
181- something : relationship ( {
182- ref : 'Thing' ,
183- ui : {
184- displayMode : 'cards' ,
185- cardFields : [ 'name' ] ,
186- inlineConnect : { labelField : 'name' , searchFields : [ 'notText' ] } ,
187- } ,
188- } ) ,
189- } ,
190- } ) ,
191- Thing,
192- } ,
193- } ) ,
194- { } as any
195- )
196- ) . toThrowErrorMatchingInlineSnapshot (
197- `"The ui.searchFields option for field 'A.something' includes 'notText' but that field doesn't have a contains filter that accepts a GraphQL String"`
198- )
128+ ) . toThrowErrorMatchingInlineSnapshot ( `""doesNotExist" is not a field of list "Thing""` )
199129} )
0 commit comments