test(desktop): scroll sidebar drag source into view

Signed-off-by: loganj <loganj@squareup.com>
This commit is contained in:
Logan Johnson
2026-08-18 13:48:39 +00:00
parent 0caaa62104
commit ab58a51819
3 changed files with 22 additions and 2 deletions

View File

@@ -111,6 +111,7 @@ export function AppSidebar({
onSelectProjects,
onSelectPulse,
onSelectWorkflows,
onSelectWorkstreamBoard,
onSelectHome,
onSelectChannel,
onOpenSearchResult,

View File

@@ -1,4 +1,4 @@
import { Activity, Bot, Folders, Inbox, Zap } from "lucide-react";
import { Activity, Bot, Folders, Inbox, Kanban, Zap } from "lucide-react";
import { TopbarSearch } from "@/features/search/ui/TopbarSearch";
import { SidebarProjectsSection } from "@/features/sidebar/ui/SidebarProjectsSection";
@@ -20,7 +20,8 @@ type SidebarSelectedView =
| "agents"
| "workflows"
| "pulse"
| "projects";
| "projects"
| "workstreamBoard";
type AppSidebarPinnedHeaderProps = {
channelLabels: Record<string, string>;
@@ -183,6 +184,20 @@ export function AppSidebarPrimaryMenu({
</SidebarMenuButton>
</SidebarMenuItem>
</FeatureGate>
<FeatureGate feature="workstreamBoard">
<SidebarMenuItem>
<SidebarMenuButton
data-testid="open-workstream-board-view"
isActive={selectedView === "workstreamBoard"}
onClick={onSelectWorkstreamBoard}
tooltip="Workstream Board"
type="button"
>
<Kanban className="h-4 w-4" />
<SidebarMenuLabel>Workstream Board</SidebarMenuLabel>
</SidebarMenuButton>
</SidebarMenuItem>
</FeatureGate>
</SidebarMenu>
</SidebarHeader>
<SidebarProjectsSection />

View File

@@ -31,6 +31,9 @@ async function seedChannelSections(page: Page) {
// pointer down, past the activation threshold, onto the target, then releases —
// the sequence dnd-kit needs to fire onDragEnd and commit the reorder.
async function dragOver(page: Page, source: Locator, target: Locator) {
await source.evaluate((element) =>
element.scrollIntoView({ block: "center" }),
);
const from = await source.boundingBox();
if (!from) throw new Error("drag source not laid out");
const pointer = {
@@ -95,6 +98,7 @@ async function dragOver(page: Page, source: Locator, target: Locator) {
}),
);
}, destination);
await expect(page.getByTestId("sidebar-section-drag-overlay")).toBeHidden();
}
test.describe("list virtualization", () => {