Skip to content

Commit 84a67fb

Browse files
committed
feat(healpanel): fix test and suggested fixes
1 parent 0bf1e48 commit 84a67fb

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

cypress/component/HelpPanel.cy.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ describe('HelpPanel', () => {
279279
cy.get('.pf-v6-c-tabs__item').should('have.length', 2) // Back to VA + Find help tabs
280280
});
281281

282-
// Should show Learn panel content after closing the extra tab
283-
cy.contains(getMessageText('learnPanelDescription')).should('be.visible');
282+
// Find help defaults to Search when search flag is enabled; expect Search panel content
283+
cy.contains(getMessageText('searchPanelRecentSearch')).should('be.visible');
284284
})
285285

286286
it('should change tab title when switching sub-tabs', () => {

src/components/HelpPanel/HelpPanelCustomTabs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,12 @@ const useTabs = (apiStoreMock: ReturnType<typeof createTabsStore>) => {
195195

196196
useEffect(() => {
197197
const unsubscribe = subscribe(dispatch);
198+
// Sync state from current store (needed when store instance changed, e.g. flags)
199+
dispatch();
198200
return () => {
199201
unsubscribe();
200202
};
201-
}, []);
203+
}, [apiStoreMock]);
202204

203205
return {
204206
tabs,

0 commit comments

Comments
 (0)