Skip to content

Commit

Permalink
Enhance the test case
Browse files Browse the repository at this point in the history
Signed-off-by: gaobinlong <gbinlong@amazon.com>
  • Loading branch information
gaobinlong committed Mar 8, 2024
1 parent 4fbb8a1 commit e01214f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/plugins/workspace/server/integration_tests/routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,16 @@ describe('workspace service', () => {
type: 'user',
modes: ['read', 'library_read'],
};
const result: any = await osdTestServer.request
const createResult: any = await osdTestServer.request
.post(root, `/api/workspaces`)
.send({
attributes: omitId(testWorkspace),
})
.expect(200);
expect(createResult.body.success).toEqual(true);

await osdTestServer.request
.put(root, `/api/workspaces/${result.body.result.id}`)
const updateReslut: any = await osdTestServer.request
.put(root, `/api/workspaces/${createResult.body.result.id}`)
.send({
attributes: {
...omitId(testWorkspace),
Expand All @@ -151,10 +152,11 @@ describe('workspace service', () => {
permissions: permission,
})
.expect(200);
expect(updateReslut.body.success).toEqual(true);

const getResult = await osdTestServer.request.get(
root,
`/api/workspaces/${result.body.result.id}`
`/api/workspaces/${createResult.body.result.id}`
);

expect(getResult.body.success).toEqual(true);
Expand Down

0 comments on commit e01214f

Please sign in to comment.