* Find the workspace element in the sidebar and check if it shows the unread indicator.
( container: HTMLElement, workspaceId: string )
| 48 | * Find the workspace element in the sidebar and check if it shows the unread indicator. |
| 49 | */ |
| 50 | function getWorkspaceUnreadIndicator( |
| 51 | container: HTMLElement, |
| 52 | workspaceId: string |
| 53 | ): { element: HTMLElement; hasUnreadBar: boolean } | null { |
| 54 | const workspaceEl = container.querySelector( |
| 55 | `[data-workspace-id="${workspaceId}"]` |
| 56 | ) as HTMLElement | null; |
| 57 | |
| 58 | if (!workspaceEl) return null; |
| 59 | |
| 60 | // The unread indicator is a StatusDot span with the idle/unread styling |
| 61 | const statusDot = workspaceEl.querySelector( |
| 62 | 'span[class*="bg-surface-invert-secondary"]' |
| 63 | ) as HTMLElement | null; |
| 64 | |
| 65 | return { |
| 66 | element: workspaceEl, |
| 67 | hasUnreadBar: statusDot !== null && !statusDot.className.includes("opacity-0"), |
| 68 | }; |
| 69 | } |
| 70 | |
| 71 | describe("Unread indicator (mock AI router)", () => { |
| 72 | beforeAll(async () => { |
no outgoing calls
no test coverage detected