-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from chingu-x/fix-post-new-tech
Fix POST voyages/teams/{teamId}/techs bug
- Loading branch information
Showing
9 changed files
with
77 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
. "$(dirname "$0")/common.sh" | ||
|
||
yarn lint-staged | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,6 +213,7 @@ describe("Techs Controller (e2e)", () => { | |
); | ||
}); | ||
}); | ||
|
||
it("should return 403 if a user of other team tries to add a tech stack item", async () => { | ||
const { access_token } = await loginAndGetTokens( | ||
"[email protected]", | ||
|
@@ -233,6 +234,27 @@ describe("Techs Controller (e2e)", () => { | |
.expect(403); | ||
}); | ||
|
||
it("should return 403 if a user tries to add a tech stack item to a category for another team", async () => { | ||
const { access_token } = await loginAndGetTokens( | ||
"[email protected]", | ||
"password", | ||
app, | ||
); | ||
const teamId: number = 1; | ||
const teamMemberId: number = 1; | ||
const categoryId: number = 51; | ||
|
||
return request(app.getHttpServer()) | ||
.post(`/voyages/teams/${teamId}/techs`) | ||
.set("Cookie", access_token) | ||
.send({ | ||
techName: newTechName + "678", | ||
techCategoryId: categoryId, | ||
voyageTeamMemberId: teamMemberId, | ||
}) | ||
.expect(403); | ||
}); | ||
|
||
it("should return 404 if invalid teamId provided", async () => { | ||
const teamId: number = 9999999; | ||
const teamMemberId: number = 8; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters