diff --git a/packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.spec.ts b/packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.spec.ts index 32dd600648..f6742f1639 100644 --- a/packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.spec.ts +++ b/packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.spec.ts @@ -21,7 +21,9 @@ import '@testing-library/jest-dom/vitest'; import { render, screen, within } from '@testing-library/svelte'; import { beforeEach, expect, test, vi } from 'vitest'; +import { notificationQueue } from '/@/stores/notifications'; import { openshellSandboxes } from '/@/stores/openshell-sandboxes'; +import type { NotificationCard } from '/@api/notification'; import type { GatewaySandboxes } from '/@api/openshell-gateway-info'; import AgentWorkspaceList from './AgentWorkspaceList.svelte'; @@ -29,6 +31,7 @@ import AgentWorkspaceList from './AgentWorkspaceList.svelte'; beforeEach(() => { vi.resetAllMocks(); openshellSandboxes.set([]); + notificationQueue.set([]); }); test('Expect empty screen when no workspaces', () => { @@ -102,3 +105,27 @@ test('Expect page title to be Agentic Workspaces', () => { expect(screen.getByText('Agentic Workspaces')).toBeInTheDocument(); }); + +test('Expect NotificationsBox to be hidden when there are no notifications', () => { + render(AgentWorkspaceList); + + const notificationsBox = screen.queryByLabelText('Notifications Box'); + expect(notificationsBox).not.toBeInTheDocument(); +}); + +test('Expect NotificationsBox to be visible when there are highlighted notifications', () => { + const notification: NotificationCard = { + id: 1, + extensionId: 'extension', + title: 'Test notification', + body: 'Test body', + type: 'info', + highlight: true, + }; + notificationQueue.set([notification]); + + render(AgentWorkspaceList); + + const notificationsBox = screen.queryByLabelText('Notifications Box'); + expect(notificationsBox).toBeInTheDocument(); +}); diff --git a/packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte b/packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte index 23829510e2..a2d136e9ce 100644 --- a/packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte +++ b/packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte @@ -11,6 +11,7 @@ import { TableRow, } from '@podman-desktop/ui-svelte'; +import NotificationsBox from '/@/lib/dashboard/NotificationsBox.svelte'; import NoLogIcon from '/@/lib/ui/NoLogIcon.svelte'; import { handleNavigation } from '/@/navigation'; import { @@ -100,6 +101,7 @@ const sandboxColumns = [ {#snippet content()}
+