@@ -149,6 +149,18 @@ describe('Relationships', () => {
149149 expect ( status ) . toEqual ( 400 ) ;
150150 } ) ;
151151
152+ describe ( 'Custom ID' , ( ) => {
153+ it ( 'should query a custom id relation' , async ( ) => {
154+ const { doc } = await client . findByID < Post > ( { id : post . id } ) ;
155+ expect ( doc ?. customIdRelation ) . toMatchObject ( { id : generatedCustomId } ) ;
156+ } ) ;
157+
158+ it ( 'should query a custom id number relation' , async ( ) => {
159+ const { doc } = await client . findByID < Post > ( { id : post . id } ) ;
160+ expect ( doc ?. customIdNumberRelation ) . toMatchObject ( { id : generatedCustomIdNumber } ) ;
161+ } ) ;
162+ } ) ;
163+
152164 describe ( 'depth' , ( ) => {
153165 it ( 'should populate to depth' , async ( ) => {
154166 const { doc } = await client . findByID < Post > ( { id : post . id , options : { depth : 2 } } ) ;
@@ -171,16 +183,6 @@ describe('Relationships', () => {
171183 // should not affect other fields
172184 expect ( doc ?. relationField ) . toMatchObject ( { id : relation . id , name : relation . name } ) ;
173185 } ) ;
174-
175- it ( 'should query a custom id relation' , async ( ) => {
176- const { doc } = await client . findByID < Post > ( { id : post . id } ) ;
177- expect ( doc ?. customIdRelation ) . toMatchObject ( { id : generatedCustomId } ) ;
178- } ) ;
179-
180- it ( 'should query a custom id number relation' , async ( ) => {
181- const { doc } = await client . findByID < Post > ( { id : post . id } ) ;
182- expect ( doc ?. customIdNumberRelation ) . toMatchObject ( { id : generatedCustomIdNumber } ) ;
183- } ) ;
184186 } ) ;
185187 } ) ;
186188 } ) ;
0 commit comments