Skip to content

Commit

Permalink
stop async item test
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy committed Sep 6, 2023
1 parent ff9a6ff commit 21f1601
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/tests/integration/items.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,26 @@ describe("Items", () => {
.expect(StatusCode.NotFound)
})
})
describe("POST /api/projects/:projectName/scenarios/:scenarioName/items/{itemId}/stop-async", () => {
it("should be able to stop async item", async () => {
const { data: { itemId } } = await stateSetup(States.ExistingTestItem)
await request(__server__)
.post(`/api/projects/test-project/scenarios/test-scenario/items/${itemId}/stop-async`)
.set(__tokenHeaderKey__, token)
.set("Accept", "application/json")
.send({ environment: "test" })
.expect(StatusCode.Ok)
})
it("should return 404 when project does not exist", async () => {
const { data: { itemId } } = await stateSetup(States.ExistingTestItem)
await request(__server__)
.post(`/api/projects/test-project-1/scenarios/test-scenario/items/${itemId}/stop-async`)
.set(__tokenHeaderKey__, token)
.set("Accept", "application/json")
.send({ environment: "test" })
.expect(StatusCode.NotFound)
})
})
describe("PUT /projects/{projectName}/scenarios/{scenarioName}/items/{itemId}", () => {
it("should be able to update test item", async () => {
const { data: { itemId } } = await stateSetup(States.ExistingTestItem)
Expand Down

0 comments on commit 21f1601

Please sign in to comment.