Skip to content

Commit

Permalink
fix: Empty entity by updating typeorm
Browse files Browse the repository at this point in the history
Fixes #7
  • Loading branch information
filipw01 committed Apr 3, 2021
1 parent 33f37a3 commit 3247dfb
Show file tree
Hide file tree
Showing 3 changed files with 464 additions and 351 deletions.
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,36 @@
},
"dependencies": {
"@types/graphql": "14.5.0",
"apollo-server-lambda": "2.21.1",
"apollo-server-lambda": "2.22.2",
"apollo-server-plugin-http-headers": "^0.1.3",
"argon2": "^0.27.0",
"aws-sdk": "^2.863.0",
"argon2": "^0.27.2",
"aws-sdk": "^2.879.0",
"bufferutil": "4.0.3",
"canvas": "2.7.0",
"class-validator": "^0.13.1",
"nanoid": "^3.1.21",
"nanoid": "^3.1.22",
"pg": "^8.3.3",
"reflect-metadata": "^0.1.13",
"source-map-support": "^0.5.19",
"type-graphql": "^1.0.0",
"typeorm": "^0.2.26",
"typeorm": "^0.2.32",
"utf-8-validate": "5.0.4"
},
"devDependencies": {
"@types/aws-lambda": "^8.10.62",
"@types/aws-lambda": "^8.10.73",
"@types/aws-sdk": "^2.7.0",
"@types/jest": "^26.0.13",
"@types/jsonwebtoken": "^8.5.0",
"@types/node": "^14.14.34",
"apollo-server-testing": "2.21.1",
"@types/jest": "^26.0.22",
"@types/jsonwebtoken": "^8.5.1",
"@types/node": "^14.14.37",
"apollo-server-testing": "2.22.2",
"env-yaml": "^0.1.2",
"jest": "^26.4.2",
"nodemon": "^2.0.4",
"prettier": "2.2.1",
"serverless": "^2.29.0",
"serverless-offline": "^6.7.0",
"serverless-s3-local": "^0.6.7",
"ts-jest": "^26.5.3",
"serverless": "^2.33.1",
"serverless-offline": "^6.9.0",
"serverless-s3-local": "^0.6.14",
"ts-jest": "^26.5.4",
"typescript": "^4.2.3"
},
"resolutions": {
Expand Down
22 changes: 22 additions & 0 deletions test/__tests__/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,26 @@ describe("User", () => {
expect(response.data).toBeNull();
expect(response.errors[0].extensions.code).toBe("INVALID_PASSWORD");
});

test("returns [] when requested budget and no budget membership present", async () => {
expect.assertions(2);
const createUserResponse = await mutate({ mutation: CREATE_USER });
server.loggedUserId = createUserResponse.data.register.id;
const GET_USER_BUDGET = gql`
query {
user {
id
budgetMembership {
accessLevel
budget {
id
}
}
}
}
`;
const { data } = await query({ query: GET_USER_BUDGET });
expect(data.user.id).toEqual(server.loggedUserId);
expect(data.user.budgetMembership).toEqual([]);
});
});
Loading

0 comments on commit 3247dfb

Please sign in to comment.