Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,53 @@
|
||||
import { describe, expect, test, vi } from "vitest";
|
||||
|
||||
vi.mock("./db/appConfiguration.db.server", () => ({
|
||||
getAppConfiguration: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("~/locale/i18n", () => ({
|
||||
i18nConfig: { supportedLngs: ["en"], fallbackLng: "en" },
|
||||
}));
|
||||
|
||||
vi.mock("~/modules/knowledgeBase/service/KnowledgeBaseService.server", () => ({
|
||||
default: {
|
||||
getAll: vi.fn(),
|
||||
getCategories: vi.fn(),
|
||||
getArticles: vi.fn(),
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock("~/modules/knowledgeBase/utils/KnowledgeBaseUtils", () => ({
|
||||
default: {
|
||||
getKbUrl: vi.fn(),
|
||||
getCategoryUrl: vi.fn(),
|
||||
getArticleUrl: vi.fn(),
|
||||
},
|
||||
}));
|
||||
|
||||
import { getSitemapDomainUrl, isAdminHostSitemapRoute, shouldSkipSitemapRouteId } from "./sitemap.server";
|
||||
|
||||
describe("getSitemapDomainUrl", () => {
|
||||
test("uses canonical routing config instead of request hosts", () => {
|
||||
expect(
|
||||
getSitemapDomainUrl({
|
||||
appBaseDomain: "example.test",
|
||||
webAppHost: "app.example.test",
|
||||
adminAppHost: "admin.example.test",
|
||||
apiHost: "api.example.test",
|
||||
protocol: "https",
|
||||
})
|
||||
).toBe("https://app.example.test");
|
||||
});
|
||||
|
||||
test("skips host clone route ids", () => {
|
||||
expect(shouldSkipSitemapRouteId("routes/admin/settings.__host")).toBe(true);
|
||||
expect(shouldSkipSitemapRouteId("routes/admin/settings")).toBe(true);
|
||||
});
|
||||
|
||||
test("detects admin-host sitemap routes that must not be emitted on the app host", () => {
|
||||
expect(isAdminHostSitemapRoute("/dashboard")).toBe(true);
|
||||
expect(isAdminHostSitemapRoute("/settings")).toBe(true);
|
||||
expect(isAdminHostSitemapRoute("/acme/dashboard")).toBe(false);
|
||||
expect(isAdminHostSitemapRoute("/login")).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user