From 58e6be315146724ede53d43c368ecd3788f4cf11 Mon Sep 17 00:00:00 2001 From: mdvanes <4253562+mdvanes@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:44:25 +0100 Subject: [PATCH] fix tests --- .../Dashboard/__snapshots__/Dashboard.test.tsx.snap | 2 -- .../src/Components/Pages/Docker/Docker.test.tsx | 11 ++++++----- apps/server/src/dockerlist/dockerlist.controller.ts | 3 ++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/client/src/Components/Pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap b/apps/client/src/Components/Pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap index 2286cd69..4662e0f1 100644 --- a/apps/client/src/Components/Pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap +++ b/apps/client/src/Components/Pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap @@ -10,8 +10,6 @@ exports[`Dashboard page contains all the control components 1`] = ` class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-md-3 css-iv7vbz-MuiGrid-root" > - - diff --git a/apps/client/src/Components/Pages/Docker/Docker.test.tsx b/apps/client/src/Components/Pages/Docker/Docker.test.tsx index 707a862e..e2cbd0dd 100644 --- a/apps/client/src/Components/Pages/Docker/Docker.test.tsx +++ b/apps/client/src/Components/Pages/Docker/Docker.test.tsx @@ -27,6 +27,7 @@ const mockDockerListResponse: DockerListResponse = { Labels: { "com.docker.compose.project": null, }, + icon: "some-icon", }, { Id: "124", @@ -58,14 +59,14 @@ describe("Docker", () => { ); - await screen.findByText(/and 1 running/); - expect(screen.getByText(/some-stopped/)).toBeVisible(); - expect(screen.queryByText("some-name")).not.toBeInTheDocument(); + await screen.findByText(/and 1 more/); + expect(screen.getByText(/some-name/)).toBeVisible(); + expect(screen.queryByText("some-stopped")).not.toBeInTheDocument(); const buttonElem = screen.getAllByRole("button")[0]; userEvent.click(buttonElem); - await screen.findByText(/some-name/); - expect(screen.getByText(/some-name/)).toBeVisible(); + await screen.findByText(/some-stopped/); expect(screen.getByText(/some-stopped/)).toBeVisible(); + expect(screen.getByText(/some-name/)).toBeVisible(); }); it("forwards an error to log", async () => { diff --git a/apps/server/src/dockerlist/dockerlist.controller.ts b/apps/server/src/dockerlist/dockerlist.controller.ts index 9b331217..1528b707 100644 --- a/apps/server/src/dockerlist/dockerlist.controller.ts +++ b/apps/server/src/dockerlist/dockerlist.controller.ts @@ -74,7 +74,8 @@ export class DockerlistController { DEFAULT_SOCKET_PATH; this.baseUrl = this.configService.get("DOCKER_BASE_URL"); - const iconsConfig = this.configService.get("DOCKER_ICONS"); + const iconsConfig = + this.configService.get("DOCKER_ICONS") ?? ""; const iconsStrings = iconsConfig.split(";"); const iconsEntries = iconsStrings.map((str) => { const [label, icon] = str.split(",");