Skip to content

Commit

Permalink
squashme: minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski committed Apr 12, 2024
1 parent 014058a commit 77b2792
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cypress-tests/cypress/support/commands/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TIMEOUTS } from "../../../config";
export const validateLogin = {
validate() {
// This returns 401 when not properly logged in
cy.request("/ui-server/api/user");
cy.request("/ui-server/api/data/user");
},
};

Expand Down
12 changes: 3 additions & 9 deletions cypress-tests/cypress/support/commands/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ const renkuLogin = (credentials: { username: string; password: string }[]) => {
.click();
}
});
cy.location().should((loc) => {
const baseURL = new URL(Cypress.config("baseUrl"));
expect(["/", ""]).to.include(loc.pathname);
expect(loc.search).to.eq("");
expect(loc.hostname).to.eq(baseURL.hostname);
})
};

const register = (
Expand All @@ -34,7 +28,7 @@ const register = (

// ? wait to be assess whether tokens were refreshed automatically or we really need to register
cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting
cy.request({ failOnStatusCode: false, url: "ui-server/api/user" }).then(
cy.request({ failOnStatusCode: false, url: "ui-server/api/data/user" }).then(
(resp) => {
if (resp.status === 200) return;

Expand Down Expand Up @@ -103,7 +97,7 @@ function registerAndVerify(props: RegisterAndVerifyProps) {
expect(loc.search).to.eq("");
expect(loc.hostname).to.eq(baseURL.hostname);
})
cy.request("ui-server/api/user").its("status").should("eq", 200);
cy.request("ui-server/api/data/user").its("status").should("eq", 200);
}

type RobustLoginProps = {
Expand All @@ -115,7 +109,7 @@ type RobustLoginProps = {

function robustLogin(props?: RobustLoginProps) {
// Check if we are already logged in
cy.request({ failOnStatusCode: false, url: "ui-server/api/user" }).then(
cy.request({ failOnStatusCode: false, url: "ui-server/api/data/user" }).then(
(resp) => {
// we are already logged in
if (resp.status >= 200 && resp.status < 400) return;
Expand Down

0 comments on commit 77b2792

Please sign in to comment.