Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdvanes committed Nov 20, 2024
1 parent fb05146 commit 58e6be3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
<mock-switches-card />
<mock-climatesensor-card />
<mock-gaschart />
<mock-homesec />
<mock-url-to-music />
<mock-log-card />
Expand Down
11 changes: 6 additions & 5 deletions apps/client/src/Components/Pages/Docker/Docker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const mockDockerListResponse: DockerListResponse = {
Labels: {
"com.docker.compose.project": null,
},
icon: "some-icon",
},
{
Id: "124",
Expand Down Expand Up @@ -58,14 +59,14 @@ describe("Docker", () => {
<LogCard />
</MockStoreProvider>
);
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 () => {
Expand Down
3 changes: 2 additions & 1 deletion apps/server/src/dockerlist/dockerlist.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export class DockerlistController {
DEFAULT_SOCKET_PATH;
this.baseUrl = this.configService.get<string>("DOCKER_BASE_URL");

const iconsConfig = this.configService.get<string>("DOCKER_ICONS");
const iconsConfig =
this.configService.get<string>("DOCKER_ICONS") ?? "";
const iconsStrings = iconsConfig.split(";");
const iconsEntries = iconsStrings.map((str) => {
const [label, icon] = str.split(",");
Expand Down

0 comments on commit 58e6be3

Please sign in to comment.