@@ -62,13 +62,13 @@ describe('update (connect)', () => {
6262 const updatePayload = {
6363 where : { id : 1 } ,
6464 data : {
65- tags : {
65+ comments : {
6666 connect : [ { id : 1 } , { id : 2 } ] ,
6767 } ,
6868 } ,
6969 } ;
7070
71- const findTagsPayload = {
71+ const findCommentsPayload = {
7272 where : {
7373 posts : {
7474 some : {
@@ -81,37 +81,37 @@ describe('update (connect)', () => {
8181 await prisma . post . update ( updatePayload ) ;
8282 await prismock . post . update ( updatePayload ) ;
8383
84- const findPostPayload = { where : { id : 1 } , include : { tags : true } } ;
84+ const findPostPayload = { where : { id : 1 } , include : { comments : true } } ;
8585
8686 const updatedPost = await prisma . post . findFirst ( findPostPayload ) ;
8787 const updatedMockedPost = await prismock . post . findFirst ( findPostPayload ) ;
8888
89- const updatedTags = await prisma . tag . findMany ( findTagsPayload ) ;
90- const updatedMockedTags = await prismock . tag . findMany ( findTagsPayload ) ;
89+ const updatedComments = await prisma . comment . findMany ( findCommentsPayload ) ;
90+ const updatedMockedComments = await prismock . comment . findMany ( findCommentsPayload ) ;
9191
9292 expect ( updatedPost ) . toMatchObject ( updatedMockedPost ) ;
93- expect ( updatedTags ) . toMatchObject ( updatedMockedTags ) ;
93+ expect ( updatedComments ) . toMatchObject ( updatedMockedComments ) ;
9494 } ) ;
9595
9696 it ( 'Should disconnect many to many relationships' , async ( ) => {
9797 const connectPayload = {
9898 where : { id : 1 } ,
9999 data : {
100- tags : {
100+ comments : {
101101 connect : [ { id : 1 } , { id : 2 } ] ,
102102 } ,
103103 } ,
104104 } ;
105105 const disconnectPayload = {
106106 where : { id : 1 } ,
107107 data : {
108- tags : {
108+ comments : {
109109 disconnect : [ { id : 2 } ] ,
110110 } ,
111111 } ,
112112 } ;
113- const findPostPayload = { where : { id : 1 } , include : { tags : true } } ;
114- const findTagsPayload = {
113+ const findPostPayload = { where : { id : 1 } , include : { comments : true } } ;
114+ const findCommentsPayload = {
115115 where : {
116116 posts : {
117117 some : {
@@ -131,10 +131,10 @@ describe('update (connect)', () => {
131131 const updatedPost = await prisma . post . findFirst ( findPostPayload ) ;
132132 const updatedMockedPost = await prismock . post . findFirst ( findPostPayload ) ;
133133
134- const updatedTags = await prisma . tag . findMany ( findTagsPayload ) ;
135- const updatedMockedTags = await prismock . tag . findMany ( findTagsPayload ) ;
134+ const updatedComments = await prisma . comment . findMany ( findCommentsPayload ) ;
135+ const updatedMockedComments = await prismock . comment . findMany ( findCommentsPayload ) ;
136136
137137 expect ( updatedPost ) . toMatchObject ( updatedMockedPost ) ;
138- expect ( updatedTags ) . toMatchObject ( updatedMockedTags ) ;
138+ expect ( updatedComments ) . toMatchObject ( updatedMockedComments ) ;
139139 } ) ;
140140} ) ;
0 commit comments