mirror of
https://github.com/block/buzz.git
synced 2026-11-12 20:31:12 +00:00
test(desktop): scroll sidebar drag source into view
Signed-off-by: loganj <loganj@squareup.com>
This commit is contained in:
@@ -111,6 +111,7 @@ export function AppSidebar({
|
||||
onSelectProjects,
|
||||
onSelectPulse,
|
||||
onSelectWorkflows,
|
||||
onSelectWorkstreamBoard,
|
||||
onSelectHome,
|
||||
onSelectChannel,
|
||||
onOpenSearchResult,
|
||||
|
||||
@@ -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 />
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user