Skip to content

Commit

Permalink
test: debug auth [TESTENG-95]
Browse files Browse the repository at this point in the history
  • Loading branch information
JComins000 committed Sep 17, 2024
1 parent 13db674 commit 9ff8727
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webui/react/src/e2e/fixtures/api.workspace.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,19 @@ export class ApiWorkspaceFixture {
* strict superset of the Response, so no info is lost.
*/
async createWorkspace(req: V1PostWorkspaceRequest): Promise<V1PostWorkspaceResponse> {
const apiAuth = this.apiAuth;
const workspaceResp = await (await this.startWorkspaceRequest())
.postWorkspace(req, {})
.catch(async function (error) {
const respBody = await streamConsumers.text(error.body);
if (error.status === 401) {
const token = apiAuth.getBearerToken();
throw new Error(
`Create Workspace Request failed. Status: ${error.status} Request: ${JSON.stringify(
req,
)} Token: ${token} Response: ${respBody}`,
);
}
throw new Error(
`Create Workspace Request failed. Status: ${error.status} Request: ${JSON.stringify(
req,
Expand Down

0 comments on commit 9ff8727

Please sign in to comment.