@@ -145,7 +145,7 @@ query Post($id: ID!) {
145
145
}
146
146
` . trim ( ) + "\n" ) ;
147
147
148
- const post = store . getters [ 'entities/posts/ query' ] ( ) . withAll ( ) . where ( 'id' , 42 ) . first ( ) ;
148
+ const post = Post . query ( ) . withAll ( ) . where ( 'id' , 42 ) . first ( ) ;
149
149
expect ( post . title ) . toEqual ( 'Example Post 5' ) ;
150
150
expect ( post . comments . length ) . toEqual ( 1 ) ;
151
151
expect ( post . comments [ 0 ] . content ) . toEqual ( 'Works!' ) ;
@@ -375,7 +375,7 @@ mutation CreatePost($post: PostInput!) {
375
375
} ;
376
376
377
377
const request = await sendWithMockFetch ( response , async ( ) => {
378
- const user = store . getters [ 'entities/users/ find' ] ( 1 ) ;
378
+ const user = User . find ( 1 ) ;
379
379
user . name = 'Snoopy' ;
380
380
381
381
await store . dispatch ( 'entities/users/push' , { data : user } ) ;
@@ -427,7 +427,7 @@ mutation DeleteUser($id: ID!) {
427
427
428
428
describe ( 'custom mutation' , ( ) => {
429
429
it ( 'sends the correct query to the API' , async ( ) => {
430
- const post = store . getters [ 'entities/posts/ find' ] ( 1 ) ;
430
+ const post = Post . find ( 1 ) ;
431
431
const response = {
432
432
data : {
433
433
upvotePost : {
@@ -492,7 +492,7 @@ mutation UpvotePost($post: PostInput!, $captchaToken: String!) {
492
492
let user = insertedData . users [ 0 ] ;
493
493
expect ( user . $isPersisted ) . toBeFalsy ( ) ;
494
494
495
- user = store . getters [ 'entities/users/ find' ] ( user . id ) ;
495
+ user = User . find ( user . id ) ;
496
496
expect ( user . $isPersisted ) . toBeFalsy ( ) ;
497
497
} ) ;
498
498
@@ -556,7 +556,7 @@ mutation UpvotePost($post: PostInput!, $captchaToken: String!) {
556
556
await store . dispatch ( 'entities/users/fetch' , { filter : { id : 1 } } ) ;
557
557
} ) ;
558
558
559
- const user = store . getters [ 'entities/users/ find' ] ( 1 ) ;
559
+ const user = User . find ( 1 ) ;
560
560
expect ( user . $isPersisted ) . toBeTruthy ( ) ;
561
561
} ) ;
562
562
} ) ;
0 commit comments