Skip to content

Commit

Permalink
fixed createHub e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
gianlazz committed May 26, 2024
1 parent 460d6a8 commit 9b35b9d
Showing 1 changed file with 36 additions and 25 deletions.
61 changes: 36 additions & 25 deletions test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,41 +125,52 @@ describe('AppController (e2e)', () => {
.set({ authorization: `Bearer ${token}` })
.send({
operationName: null,
query: `mutation createHub($image: String!, $name: String!, $description: String!, $latitude: Float!, $longitude: Float!) {
createHub(image: $image, name: $name, description: $description, latitude: $latitude, longitude: $longitude) {
userId
hubId
isOwner
starred
isPresent
hub {
id
name
description
active
image
latitude
longitude
usersConnection {
isPresent
isOwner
__typename
query: `mutation createHub(
$name: String!
$description: String
$latitude: Float!
$longitude: Float!
$locationLabel: String
$imageFile: Upload
){
createHub(
name: $name,
description: $description,
latitude: $latitude,
longitude: $longitude
locationLabel: $locationLabel
imageFile: $imageFile
) {
userId
hubId
isOwner
starred
isPresent
hub {
id
name
description
active
image
latitude
longitude
usersConnection {
isPresent
isOwner
}
}
}
__typename
}
__typename
}
}
}
`,
variables: {
description: 'test',
latitude: 0,
longitude: 0,
name: 'test',
locationLabel: 'test location label'
},
})
.expect(200);

expect(result.body?.data?.createHub?.hub).toBeDefined();
expect(result.body?.data?.createHub?.hubId).toBeDefined();
hubId = result.body?.data?.createHub?.hubId;
Expand Down

0 comments on commit 9b35b9d

Please sign in to comment.