1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-25 06:49:23 +01:00
Files
dozzle/assets/models/Container.spec.ts
Amir Raminfar 14fc1190a8 feat: supports multiple hosts in parallel and update hosts menu (#2269)
* feat: updates host menu to be part of side menu

* updates routes to be host/id

* fixes go tests

* fixes js tests

* fixes typescheck

* fixes int tests

* fixes mobile

* fixes bug in merging containers

* fixed minor bug with menu
2023-06-24 19:13:39 +00:00

20 lines
689 B
TypeScript

import { describe, expect, test } from "vitest";
import { Container } from "./Container";
describe("Container", () => {
const names = [
[
"foo.gb1cto7gaq68fp4refnsr5hep.byqr1prci82zyfoos6gx1yhz0",
"foo",
".gb1cto7gaq68fp4refnsr5hep.byqr1prci82zyfoos6gx1yhz0",
],
["bar.gb1cto7gaq68fp4refnsr5hep", "bar", ".gb1cto7gaq68fp4refnsr5hep"],
["baz", "baz", null],
];
test.each(names)("name %s should be %s and %s", (name, expectedName, expectedSwarmId) => {
const c = new Container("id", new Date(), "image", name!, "command", "host", "status", "created");
expect(c.name).toBe(expectedName);
expect(c.swarmId).toBe(expectedSwarmId);
});
});