mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
fixing AppReduced.spec.ts
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user