mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: add missing values to test
This commit is contained in:
@@ -14,6 +14,9 @@ import {
|
||||
import { beforeEach, expect, test, vi } from "vitest";
|
||||
|
||||
const baseAdmin: Admin = {
|
||||
cleanupCacheApplications: false,
|
||||
cleanupCacheOnCompose: false,
|
||||
cleanupCacheOnPreviews: false,
|
||||
createdAt: "",
|
||||
authId: "",
|
||||
adminId: "string",
|
||||
@@ -38,7 +41,7 @@ test("Should read the configuration file", () => {
|
||||
const config: FileConfig = loadOrCreateConfig("dokploy");
|
||||
|
||||
expect(config.http?.routers?.["dokploy-router-app"]?.service).toBe(
|
||||
"dokploy-service-app",
|
||||
"dokploy-service-app"
|
||||
);
|
||||
});
|
||||
|
||||
@@ -48,13 +51,13 @@ test("Should apply redirect-to-https", () => {
|
||||
...baseAdmin,
|
||||
certificateType: "letsencrypt",
|
||||
},
|
||||
"example.com",
|
||||
"example.com"
|
||||
);
|
||||
|
||||
const config: FileConfig = loadOrCreateConfig("dokploy");
|
||||
|
||||
expect(config.http?.routers?.["dokploy-router-app"]?.middlewares).toContain(
|
||||
"redirect-to-https",
|
||||
"redirect-to-https"
|
||||
);
|
||||
});
|
||||
|
||||
@@ -81,7 +84,7 @@ test("Should remove websecure if https rollback to http", () => {
|
||||
|
||||
updateServerTraefik(
|
||||
{ ...baseAdmin, certificateType: "letsencrypt" },
|
||||
"example.com",
|
||||
"example.com"
|
||||
);
|
||||
|
||||
updateServerTraefik({ ...baseAdmin, certificateType: "none" }, "example.com");
|
||||
@@ -90,6 +93,6 @@ test("Should remove websecure if https rollback to http", () => {
|
||||
|
||||
expect(config.http?.routers?.["dokploy-router-app-secure"]).toBeUndefined();
|
||||
expect(
|
||||
config.http?.routers?.["dokploy-router-app"]?.middlewares,
|
||||
config.http?.routers?.["dokploy-router-app"]?.middlewares
|
||||
).not.toContain("redirect-to-https");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user