Skip to content

Commit

Permalink
SLVUU-129: Refactor URL constants
Browse files Browse the repository at this point in the history
  • Loading branch information
pling-scottlogic committed Jan 10, 2024
1 parent fe2ef9c commit dcc04bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions vuu-ui/cypress/e2e/layout-management/api/api.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ export type LayoutResponseDto = {
metadata: LayoutMetadata;
};

export const LAYOUT_API_BASE_URL = "http://localhost:8081/api";
const LAYOUT_API_BASE_URL = "http://localhost:8081/api";

export const APPLICATION_LAYOUT_URL =
LAYOUT_API_BASE_URL + "/application-layouts/";
export const USER_LAYOUT_URL = LAYOUT_API_BASE_URL + "/layouts/";
export const USER_LAYOUT_URL =
LAYOUT_API_BASE_URL + "/layouts/";

export const TEST_LAYOUT_ID_ALIAS = "TEST_LAYOUT_ID";
export const DEFAULT_APPLICATION_LAYOUT_ALIAS = "DEFAULT_APPLICATION_LAYOUT";
Expand Down
8 changes: 4 additions & 4 deletions vuu-ui/cypress/e2e/layout-management/api/user-layouts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {
createLayout,
deleteLayout,
getLayout,
LAYOUT_API_BASE_URL,
TEST_LAYOUT_ID_ALIAS,
TEST_LAYOUT_JSON,
TEST_METADATA_DTO,
USER_LAYOUT_URL,
} from "./api.utils";

describe("User Layouts", () => {
Expand Down Expand Up @@ -56,7 +56,7 @@ describe("User Layouts", () => {
it("should return a 200", () => {
cy.request({
method: "GET",
url: LAYOUT_API_BASE_URL + "/layouts/metadata",
url: USER_LAYOUT_URL + "metadata",
}).then((response) => {
expect(response.status).to.eq(200);
expect(response.body).to.have.lengthOf(1);
Expand All @@ -78,7 +78,7 @@ describe("User Layouts", () => {
cy.request({
method: "PUT",
url:
LAYOUT_API_BASE_URL + "/layouts/" + Cypress.env(TEST_LAYOUT_ID_ALIAS),
USER_LAYOUT_URL + Cypress.env(TEST_LAYOUT_ID_ALIAS),
body: {
metadata: TEST_METADATA_DTO,
definition: { ...TEST_LAYOUT_JSON, type: "Column" },
Expand All @@ -101,7 +101,7 @@ describe("User Layouts", () => {
cy.request({
method: "DELETE",
url:
LAYOUT_API_BASE_URL + "/layouts/" + Cypress.env(TEST_LAYOUT_ID_ALIAS),
USER_LAYOUT_URL + Cypress.env(TEST_LAYOUT_ID_ALIAS),
})
.then((response) => {
expect(response.status).to.eq(204);
Expand Down

0 comments on commit dcc04bc

Please sign in to comment.