Skip to content

Commit

Permalink
refactor: adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BarcoMasile committed Oct 17, 2024
1 parent 7b4320c commit bf46b9b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/src/util/basePaths.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2024 Canonical Ltd.
// SPDX-License-Identifier: AGPL-3.0

import {
appendBasePath,
calculateBasePath,
Expand Down Expand Up @@ -63,6 +66,7 @@ describe("calculateBasePath", () => {

describe("appendBasePath", () => {
it("handles paths with a leading slash", () => {
setBase("/test/");
expect(appendBasePath("/test")).toBe("/example/ui/test");
});

Expand All @@ -73,10 +77,10 @@ describe("appendBasePath", () => {

describe("appendAPIBasePath", () => {
it("handles paths with a leading slash", () => {
expect(appendAPIBasePath("/test")).toBe("/api/v0/test");
expect(appendAPIBasePath("/test")).toBe("/example/ui/api/v0/test");
});

it("handles paths without a leading slash", () => {
expect(appendAPIBasePath("test")).toBe("/api/v0/test");
expect(appendAPIBasePath("test")).toBe("/example/ui/api/v0/test");
});
});

0 comments on commit bf46b9b

Please sign in to comment.