fixing AppReduced.spec.ts

This commit is contained in:
dswbx
2025-08-03 13:10:49 +02:00
parent 64e400c4f1
commit 2fb07698d5
2 changed files with 4 additions and 2 deletions

View File

@@ -133,6 +133,7 @@ describe("AppReduced", () => {
const options = appReduced.options;
expect(options).toEqual({
basepath: "/",
logo_return_path: "/custom-home",
admin_basepath: "/custom-admin",
});
@@ -187,7 +188,7 @@ describe("AppReduced", () => {
appReduced = new AppReduced(mockAppJson, options);
const result = appReduced.getAbsolutePath("entity/");
expect(result).toBe("~/admin/entity/");
expect(result).toBe("~/admin/entity");
});
it("should remove trailing slashes from non-entity paths", () => {

View File

@@ -86,7 +86,8 @@ export class AppReduced {
return [absolute ? "~" : null, this.options.basepath, this.options.admin_basepath, ...paths]
.filter(Boolean)
.join("/")
.replace(/\/+/g, "/");
.replace(/\/+/g, "/")
.replace(/\/$/, "");
}
getSettingsPath(path: string[] = []): string {