Skip to content

Commit

Permalink
Fix instrumentation v2 cypress auth handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippluca committed Jan 11, 2024
1 parent 295a618 commit 1099eee
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/client/cypress/e2e/editor/instrumentation-v2.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { loginAsAdmin, adminUserAuth, createBorehole } from "../testHelpers";
import { loginAsAdmin, bearerAuth, createBorehole } from "../testHelpers";

const openDropdown = dataCy => {
cy.get(`[data-cy="${dataCy}"]`)
Expand All @@ -18,8 +18,8 @@ describe("Instrumentation crud tests", () => {
createBorehole({ "extended.original_name": "INTEADAL" })
.as("borehole_id")
.then(id =>
cy
.request({
cy.get("@id_token").then(token => {
cy.request({
method: "POST",
url: "/api/v2/completion",
cache: "no-cache",
Expand All @@ -32,17 +32,18 @@ describe("Instrumentation crud tests", () => {
isPrimary: true,
kindId: 16000002,
},
auth: adminUserAuth,
})
.then(response => {
auth: bearerAuth(token),
}).then(response => {
expect(response).to.have.property("status", 200);
}),
});
}),
);

// open completion editor
cy.get("@borehole_id").then(id =>
loginAsAdmin(`/editor/${id}/completion/v2`),
);
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/editor/${id}/completion/v2`);
});

cy.contains("Tabs");

Expand Down

0 comments on commit 1099eee

Please sign in to comment.