diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap index bc44087260f1..40e51d52de30 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap @@ -341,6 +341,15 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -502,6 +511,15 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -2261,6 +2279,15 @@ exports[`CollapsibleNav renders the default nav 1`] = ` "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -2513,6 +2540,15 @@ exports[`CollapsibleNav renders the default nav 2`] = ` "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -2765,6 +2801,15 @@ exports[`CollapsibleNav renders the default nav 3`] = ` "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -2884,6 +2929,15 @@ exports[`CollapsibleNav renders the default nav 3`] = ` "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -3562,6 +3616,15 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 1`] = "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -3718,6 +3781,43 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 1`] = "syncErrorThrown": false, "syncErrorValue": null, }, + Subscriber { + "_parentOrParents": null, + "_subscriptions": Array [ + SubjectSubscription { + "_parentOrParents": [Circular], + "_subscriptions": null, + "closed": false, + "subject": [Circular], + "subscriber": [Circular], + }, + ], + "closed": false, + "destination": SafeSubscriber { + "_complete": undefined, + "_context": [Circular], + "_error": undefined, + "_next": [Function], + "_parentOrParents": null, + "_parentSubscriber": [Circular], + "_subscriptions": null, + "closed": false, + "destination": Object { + "closed": true, + "complete": [Function], + "error": [Function], + "next": [Function], + }, + "isStopped": false, + "syncErrorThrowable": false, + "syncErrorThrown": false, + "syncErrorValue": null, + }, + "isStopped": false, + "syncErrorThrowable": true, + "syncErrorThrown": false, + "syncErrorValue": null, + }, ], "thrownError": null, }, @@ -3797,6 +3897,15 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 1`] = "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -3953,6 +4062,43 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 1`] = "syncErrorThrown": false, "syncErrorValue": null, }, + Subscriber { + "_parentOrParents": null, + "_subscriptions": Array [ + SubjectSubscription { + "_parentOrParents": [Circular], + "_subscriptions": null, + "closed": false, + "subject": [Circular], + "subscriber": [Circular], + }, + ], + "closed": false, + "destination": SafeSubscriber { + "_complete": undefined, + "_context": [Circular], + "_error": undefined, + "_next": [Function], + "_parentOrParents": null, + "_parentSubscriber": [Circular], + "_subscriptions": null, + "closed": false, + "destination": Object { + "closed": true, + "complete": [Function], + "error": [Function], + "next": [Function], + }, + "isStopped": false, + "syncErrorThrowable": false, + "syncErrorThrown": false, + "syncErrorValue": null, + }, + "isStopped": false, + "syncErrorThrowable": true, + "syncErrorThrown": false, + "syncErrorValue": null, + }, ], "thrownError": null, }, @@ -5020,6 +5166,15 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 2`] = "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -5176,6 +5331,43 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 2`] = "syncErrorThrown": false, "syncErrorValue": null, }, + Subscriber { + "_parentOrParents": null, + "_subscriptions": Array [ + SubjectSubscription { + "_parentOrParents": [Circular], + "_subscriptions": null, + "closed": false, + "subject": [Circular], + "subscriber": [Circular], + }, + ], + "closed": false, + "destination": SafeSubscriber { + "_complete": undefined, + "_context": [Circular], + "_error": undefined, + "_next": [Function], + "_parentOrParents": null, + "_parentSubscriber": [Circular], + "_subscriptions": null, + "closed": false, + "destination": Object { + "closed": true, + "complete": [Function], + "error": [Function], + "next": [Function], + }, + "isStopped": false, + "syncErrorThrowable": false, + "syncErrorThrown": false, + "syncErrorValue": null, + }, + "isStopped": false, + "syncErrorThrowable": true, + "syncErrorThrown": false, + "syncErrorValue": null, + }, ], "thrownError": null, }, @@ -5255,6 +5447,15 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 2`] = "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -5411,6 +5612,43 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 2`] = "syncErrorThrown": false, "syncErrorValue": null, }, + Subscriber { + "_parentOrParents": null, + "_subscriptions": Array [ + SubjectSubscription { + "_parentOrParents": [Circular], + "_subscriptions": null, + "closed": false, + "subject": [Circular], + "subscriber": [Circular], + }, + ], + "closed": false, + "destination": SafeSubscriber { + "_complete": undefined, + "_context": [Circular], + "_error": undefined, + "_next": [Function], + "_parentOrParents": null, + "_parentSubscriber": [Circular], + "_subscriptions": null, + "closed": false, + "destination": Object { + "closed": true, + "complete": [Function], + "error": [Function], + "next": [Function], + }, + "isStopped": false, + "syncErrorThrowable": false, + "syncErrorThrown": false, + "syncErrorValue": null, + }, + "isStopped": false, + "syncErrorThrowable": true, + "syncErrorThrown": false, + "syncErrorValue": null, + }, ], "thrownError": null, }, @@ -6476,6 +6714,15 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 3`] = "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -6632,6 +6879,43 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 3`] = "syncErrorThrown": false, "syncErrorValue": null, }, + Subscriber { + "_parentOrParents": null, + "_subscriptions": Array [ + SubjectSubscription { + "_parentOrParents": [Circular], + "_subscriptions": null, + "closed": false, + "subject": [Circular], + "subscriber": [Circular], + }, + ], + "closed": false, + "destination": SafeSubscriber { + "_complete": undefined, + "_context": [Circular], + "_error": undefined, + "_next": [Function], + "_parentOrParents": null, + "_parentSubscriber": [Circular], + "_subscriptions": null, + "closed": false, + "destination": Object { + "closed": true, + "complete": [Function], + "error": [Function], + "next": [Function], + }, + "isStopped": false, + "syncErrorThrowable": false, + "syncErrorThrown": false, + "syncErrorValue": null, + }, + "isStopped": false, + "syncErrorThrowable": true, + "syncErrorThrown": false, + "syncErrorValue": null, + }, ], "thrownError": null, }, @@ -6711,6 +6995,15 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 3`] = "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -6867,6 +7160,43 @@ exports[`CollapsibleNav renders the nav bar with custom logo in dark mode 3`] = "syncErrorThrown": false, "syncErrorValue": null, }, + Subscriber { + "_parentOrParents": null, + "_subscriptions": Array [ + SubjectSubscription { + "_parentOrParents": [Circular], + "_subscriptions": null, + "closed": false, + "subject": [Circular], + "subscriber": [Circular], + }, + ], + "closed": false, + "destination": SafeSubscriber { + "_complete": undefined, + "_context": [Circular], + "_error": undefined, + "_next": [Function], + "_parentOrParents": null, + "_parentSubscriber": [Circular], + "_subscriptions": null, + "closed": false, + "destination": Object { + "closed": true, + "complete": [Function], + "error": [Function], + "next": [Function], + }, + "isStopped": false, + "syncErrorThrowable": false, + "syncErrorThrown": false, + "syncErrorValue": null, + }, + "isStopped": false, + "syncErrorThrowable": true, + "syncErrorThrown": false, + "syncErrorValue": null, + }, ], "thrownError": null, }, @@ -7935,6 +8265,15 @@ exports[`CollapsibleNav renders the nav bar with custom logo in default mode 1`] "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -8054,6 +8393,43 @@ exports[`CollapsibleNav renders the nav bar with custom logo in default mode 1`] "syncErrorThrown": false, "syncErrorValue": null, }, + Subscriber { + "_parentOrParents": null, + "_subscriptions": Array [ + SubjectSubscription { + "_parentOrParents": [Circular], + "_subscriptions": null, + "closed": false, + "subject": [Circular], + "subscriber": [Circular], + }, + ], + "closed": false, + "destination": SafeSubscriber { + "_complete": undefined, + "_context": [Circular], + "_error": undefined, + "_next": [Function], + "_parentOrParents": null, + "_parentSubscriber": [Circular], + "_subscriptions": null, + "closed": false, + "destination": Object { + "closed": true, + "complete": [Function], + "error": [Function], + "next": [Function], + }, + "isStopped": false, + "syncErrorThrowable": false, + "syncErrorThrown": false, + "syncErrorValue": null, + }, + "isStopped": false, + "syncErrorThrowable": true, + "syncErrorThrown": false, + "syncErrorValue": null, + }, ], "thrownError": null, }, @@ -8133,6 +8509,15 @@ exports[`CollapsibleNav renders the nav bar with custom logo in default mode 1`] "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -8252,6 +8637,43 @@ exports[`CollapsibleNav renders the nav bar with custom logo in default mode 1`] "syncErrorThrown": false, "syncErrorValue": null, }, + Subscriber { + "_parentOrParents": null, + "_subscriptions": Array [ + SubjectSubscription { + "_parentOrParents": [Circular], + "_subscriptions": null, + "closed": false, + "subject": [Circular], + "subscriber": [Circular], + }, + ], + "closed": false, + "destination": SafeSubscriber { + "_complete": undefined, + "_context": [Circular], + "_error": undefined, + "_next": [Function], + "_parentOrParents": null, + "_parentSubscriber": [Circular], + "_subscriptions": null, + "closed": false, + "destination": Object { + "closed": true, + "complete": [Function], + "error": [Function], + "next": [Function], + }, + "isStopped": false, + "syncErrorThrowable": false, + "syncErrorThrown": false, + "syncErrorValue": null, + }, + "isStopped": false, + "syncErrorThrowable": true, + "syncErrorThrown": false, + "syncErrorValue": null, + }, ], "thrownError": null, }, @@ -9317,6 +9739,15 @@ exports[`CollapsibleNav renders the nav bar with custom logo in default mode 2`] "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -9436,6 +9867,43 @@ exports[`CollapsibleNav renders the nav bar with custom logo in default mode 2`] "syncErrorThrown": false, "syncErrorValue": null, }, + Subscriber { + "_parentOrParents": null, + "_subscriptions": Array [ + SubjectSubscription { + "_parentOrParents": [Circular], + "_subscriptions": null, + "closed": false, + "subject": [Circular], + "subscriber": [Circular], + }, + ], + "closed": false, + "destination": SafeSubscriber { + "_complete": undefined, + "_context": [Circular], + "_error": undefined, + "_next": [Function], + "_parentOrParents": null, + "_parentSubscriber": [Circular], + "_subscriptions": null, + "closed": false, + "destination": Object { + "closed": true, + "complete": [Function], + "error": [Function], + "next": [Function], + }, + "isStopped": false, + "syncErrorThrowable": false, + "syncErrorThrown": false, + "syncErrorValue": null, + }, + "isStopped": false, + "syncErrorThrowable": true, + "syncErrorThrown": false, + "syncErrorValue": null, + }, ], "thrownError": null, }, @@ -9515,6 +9983,15 @@ exports[`CollapsibleNav renders the nav bar with custom logo in default mode 2`] "observers": Array [], "thrownError": null, }, + "hasFetchedWorkspaceList$": BehaviorSubject { + "_isScalar": false, + "_value": false, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [], + "thrownError": null, + }, "renderWorkspaceMenu": [MockFunction], "workspaceEnabled$": BehaviorSubject { "_isScalar": false, @@ -9634,6 +10111,43 @@ exports[`CollapsibleNav renders the nav bar with custom logo in default mode 2`] "syncErrorThrown": false, "syncErrorValue": null, }, + Subscriber { + "_parentOrParents": null, + "_subscriptions": Array [ + SubjectSubscription { + "_parentOrParents": [Circular], + "_subscriptions": null, + "closed": false, + "subject": [Circular], + "subscriber": [Circular], + }, + ], + "closed": false, + "destination": SafeSubscriber { + "_complete": undefined, + "_context": [Circular], + "_error": undefined, + "_next": [Function], + "_parentOrParents": null, + "_parentSubscriber": [Circular], + "_subscriptions": null, + "closed": false, + "destination": Object { + "closed": true, + "complete": [Function], + "error": [Function], + "next": [Function], + }, + "isStopped": false, + "syncErrorThrowable": false, + "syncErrorThrown": false, + "syncErrorValue": null, + }, + "isStopped": false, + "syncErrorThrowable": true, + "syncErrorThrown": false, + "syncErrorValue": null, + }, ], "thrownError": null, }, diff --git a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx index c6c2a0ee7cc2..8614c6f7bbf1 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx @@ -170,7 +170,7 @@ describe('CollapsibleNav', () => { ); expectShownNavLinksCount(component, 3); clickGroup(component, 'opensearchDashboards'); - clickGroup(component, 'recentlyViewed'); + clickGroup(component, 'recentlyVisited'); expectShownNavLinksCount(component, 1); component.setProps({ isNavOpen: false }); expectNavIsClosed(component); @@ -200,7 +200,7 @@ describe('CollapsibleNav', () => { }, }); - component.find('[data-test-subj="collapsibleNavGroup-recentlyViewed"] a').simulate('click'); + component.find('[data-test-subj="collapsibleNavGroup-recentlyVisited"] a').simulate('click'); expect(onClose.callCount).toEqual(1); expectNavIsClosed(component); component.setProps({ isNavOpen: true });