mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-22 15:45:22 +02:00
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { addDokployNetworkToRoot } from "@/server/utils/docker/domain";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
describe("addDokployNetworkToRoot", () => {
|
|
it("should create network object if networks is undefined", () => {
|
|
const result = addDokployNetworkToRoot(undefined);
|
|
expect(result).toEqual({ "dokploy-network": { external: true } });
|
|
});
|
|
|
|
it("should add network to an empty object", () => {
|
|
const result = addDokployNetworkToRoot({});
|
|
expect(result).toEqual({ "dokploy-network": { external: true } });
|
|
});
|
|
|
|
it("should not modify existing network configuration", () => {
|
|
const existing = { "dokploy-network": { external: false } };
|
|
const result = addDokployNetworkToRoot(existing);
|
|
expect(result).toEqual({ "dokploy-network": { external: true } });
|
|
});
|
|
|
|
it("should add network alongside existing networks", () => {
|
|
const existing = { "other-network": { external: true } };
|
|
const result = addDokployNetworkToRoot(existing);
|
|
expect(result).toEqual({
|
|
"other-network": { external: true },
|
|
"dokploy-network": { external: true },
|
|
});
|
|
});
|
|
});
|