Skip to content

Commit 287347f

Browse files
committed
test(desktop): give the chat panel fixture the feature flags every product surface provides
1 parent 25182f7 commit 287347f

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

‎apps/desktop/e2e/chat-panel.spec.ts‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,21 @@ import {
3333
} from '@/lib/browser-agent/transport'
3434
import { ChatPanelTrigger } from '@/app/(product)/_components/chat/panel/chat-panel-trigger'
3535
import { ResourcePanels } from '@/app/(product)/_components/chat/panel/resource-panels'
36+
import { FeatureFlagsProvider } from '@/lib/core/config/feature-flags-context'
3637
import { useMothershipResize } from '@/hooks/mothership-chat/use-mothership-resize'
3738
import { SurfaceScopeProvider } from '@/platform/lib/surface-scope'
3839
import { useChatPanelStore } from '@/stores/chat-panel/store'
3940
4041
const queryClient = new QueryClient()
4142
43+
/** The server-resolved flags the product's providers hand every chat surface. */
44+
const FEATURE_FLAGS = {
45+
dashboards: false,
46+
'workflow-tests': false,
47+
'mothership-model-selector': false,
48+
'mothership-plan-mode': false,
49+
}
50+
4251
const router: AppRouterInstance = {
4352
bfcacheId: 'fixture',
4453
back: () => history.back(),
@@ -67,6 +76,7 @@ function ChatFixture({ scopeId, userId }: ChatFixtureProps) {
6776
}
6877
return (
6978
<ResourcePanels
79+
alwaysOpenable={false}
7080
panel={{
7181
resources: [{ id: 'fixture-browser', type: 'browser', title: 'Browser', active: true }],
7282
collapsed,
@@ -86,10 +96,7 @@ function ChatFixture({ scopeId, userId }: ChatFixtureProps) {
8696
picker: {
8797
items: [],
8898
onOpen: () => {},
89-
onWorkspaceOpen: () => {},
9099
onSearchChange: () => {},
91-
moreFor: () => undefined,
92-
workspaceLoaded: () => false,
93100
onSelect: () => {},
94101
},
95102
}}
@@ -113,6 +120,7 @@ function ChatPanelFixture() {
113120
useEffect(() => initBrowserAgentTransport(), [])
114121
return (
115122
<QueryClientProvider client={queryClient}>
123+
<FeatureFlagsProvider flags={FEATURE_FLAGS}>
116124
<AppRouterContext.Provider value={router}>
117125
<SurfaceScopeProvider routePrefix='/o/fixture-organization'>
118126
<PlatformSurface theme='dark' canvas>
@@ -162,6 +170,7 @@ function ChatPanelFixture() {
162170
</PlatformSurface>
163171
</SurfaceScopeProvider>
164172
</AppRouterContext.Provider>
173+
</FeatureFlagsProvider>
165174
</QueryClientProvider>
166175
)
167176
}

0 commit comments

Comments
 (0)