Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .storybook/hooks/unleash.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// List of enabled feature flags for Storybook
const ENABLED_FLAGS = [
'platform.chrome.help-panel_knowledge-base', // Enable Knowledgebase tab
'platform.chrome.help-panel_search', // Enable Search Tab
];

// Mock useFlag hook - returns true for enabled flags
Expand Down
24 changes: 24 additions & 0 deletions src/components/HelpPanel/HelpPanelContent.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,30 @@ const mockHelpPanelHandlers = [
http.get('/api/quickstarts/v1/favorites', () => {
return HttpResponse.json({ data: [] });
}),
// Mock user identity (favorite pages) - needed when search flag is enabled
http.get('/api/chrome-service/v1/user', () => {
return HttpResponse.json({
data: { favoritePages: [] },
});
}),
http.get('/api/chrome-service/v1/static/api-specs-generated.json', () => {
return HttpResponse.json([]);
}),
http.get('/api/chrome-service/v1/static/bundles-generated.json', () => {
return HttpResponse.json([]);
}),
http.post('/api/chrome-service/v1/favorite-pages', async ({ request }) => {
const body = (await request.json()) as {
pathname: string;
favorite: boolean;
};
return HttpResponse.json([
{ pathname: body.pathname, favorite: body.favorite },
]);
}),
http.post('/api/quickstarts/v1/favorites', async () => {
return HttpResponse.json({ success: true });
}),
];

const meta: Meta<typeof HelpPanelWrapper> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const SearchForm: React.FC<SearchFormProps> = ({
value={option.value}
hasCheckbox
isSelected={selectedFilters.includes(option.value)}
data-ouia-component-id={`help-panel-search-filter-option-${option.value}`}
>
{option.label}
</SelectOption>
Expand Down
Loading
Loading