@@ -5,15 +5,15 @@ vi.mock("node:fs", () => ({
55 default : fs ,
66} ) ) ;
77
8- import type { Admin , FileConfig } from "@dokploy/server" ;
8+ import type { FileConfig , User } from "@dokploy/server" ;
99import {
1010 createDefaultServerTraefikConfig ,
1111 loadOrCreateConfig ,
1212 updateServerTraefik ,
1313} from "@dokploy/server" ;
1414import { beforeEach , expect , test , vi } from "vitest" ;
1515
16- const baseAdmin : Admin = {
16+ const baseAdmin : User = {
1717 enablePaidFeatures : false ,
1818 metricsConfig : {
1919 containers : {
@@ -40,9 +40,7 @@ const baseAdmin: Admin = {
4040 cleanupCacheApplications : false ,
4141 cleanupCacheOnCompose : false ,
4242 cleanupCacheOnPreviews : false ,
43- createdAt : "" ,
44- authId : "" ,
45- adminId : "string" ,
43+ createdAt : new Date ( ) ,
4644 serverIp : null ,
4745 certificateType : "none" ,
4846 host : null ,
@@ -53,6 +51,19 @@ const baseAdmin: Admin = {
5351 serversQuantity : 0 ,
5452 stripeCustomerId : "" ,
5553 stripeSubscriptionId : "" ,
54+ banExpires : new Date ( ) ,
55+ banned : true ,
56+ banReason : "" ,
57+ email : "" ,
58+ expirationDate : "" ,
59+ id : "" ,
60+ isRegistered : false ,
61+ name : "" ,
62+ createdAt2 : new Date ( ) . toISOString ( ) ,
63+ emailVerified : false ,
64+ image : "" ,
65+ updatedAt : new Date ( ) ,
66+ twoFactorEnabled : false ,
5667} ;
5768
5869beforeEach ( ( ) => {
@@ -103,8 +114,6 @@ test("Should not touch config without host", () => {
103114} ) ;
104115
105116test ( "Should remove websecure if https rollback to http" , ( ) => {
106- const originalConfig : FileConfig = loadOrCreateConfig ( "dokploy" ) ;
107-
108117 updateServerTraefik (
109118 { ...baseAdmin , certificateType : "letsencrypt" } ,
110119 "example.com" ,
0 commit comments