mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fixing AppReduced.spec.ts
This commit is contained in:
@@ -133,6 +133,7 @@ describe("AppReduced", () => {
|
|||||||
const options = appReduced.options;
|
const options = appReduced.options;
|
||||||
|
|
||||||
expect(options).toEqual({
|
expect(options).toEqual({
|
||||||
|
basepath: "/",
|
||||||
logo_return_path: "/custom-home",
|
logo_return_path: "/custom-home",
|
||||||
admin_basepath: "/custom-admin",
|
admin_basepath: "/custom-admin",
|
||||||
});
|
});
|
||||||
@@ -187,7 +188,7 @@ describe("AppReduced", () => {
|
|||||||
appReduced = new AppReduced(mockAppJson, options);
|
appReduced = new AppReduced(mockAppJson, options);
|
||||||
const result = appReduced.getAbsolutePath("entity/");
|
const result = appReduced.getAbsolutePath("entity/");
|
||||||
|
|
||||||
expect(result).toBe("~/admin/entity/");
|
expect(result).toBe("~/admin/entity");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should remove trailing slashes from non-entity paths", () => {
|
it("should remove trailing slashes from non-entity paths", () => {
|
||||||
|
|||||||
@@ -86,7 +86,8 @@ export class AppReduced {
|
|||||||
return [absolute ? "~" : null, this.options.basepath, this.options.admin_basepath, ...paths]
|
return [absolute ? "~" : null, this.options.basepath, this.options.admin_basepath, ...paths]
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.join("/")
|
.join("/")
|
||||||
.replace(/\/+/g, "/");
|
.replace(/\/+/g, "/")
|
||||||
|
.replace(/\/$/, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
getSettingsPath(path: string[] = []): string {
|
getSettingsPath(path: string[] = []): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user