@@ -21,11 +21,10 @@ describe("FEATURE: Menu item", () => {
2121 } ) ;
2222
2323 /* SCENARIO
24- Given 5 monitored endpoint instances sending heartbeats
25- When 1 of the endpoint instances stops sending heartbeats
26- Then the menu item in the page header updates to include a badge indicating how many have stopped
24+ Given a monitored endpoint instance sending heartbeats
25+ When the endpoint instance stops sending heartbeats
26+ Then the menu item in the page header updates to include a badge indicating it has stopped
2727 */
28-
2928 test ( "EXAMPLE: An instance starts sending heartbeats, the menu item should remove the badge" , async ( { driver } ) => {
3029 vi . useFakeTimers ( ) ;
3130 await driver . setUp ( precondition . serviceControlWithMonitoring ) ;
@@ -54,19 +53,24 @@ describe("FEATURE: Menu item", () => {
5453
5554 vi . restoreAllMocks ( ) ;
5655 } ) ;
56+
5757 /* SCENARIO
5858 Given a set of monitored endpoint instances
5959 When all instances are sending heartbeats
6060 Then the menu item in the page header does not include a badge
6161 */
62+ test ( "EXAMPLE: An unmonitored instance stops sending heartbeats, the menu item should not show a badge with a count" , async ( { driver } ) => {
63+ await driver . setUp ( precondition . serviceControlWithMonitoring ) ;
64+ await driver . setUp ( precondition . hasAnUnhealthyUnMonitoredEndpoint ( ) ) ;
6265
63- test . todo ( "EXAMPLE: An unmonitored instance stops sending heartbeats, the menu item should not show a badge with a count ") ;
66+ await driver . goTo ( "dashboard ") ;
6467
65- /* SCENARIO
66- Given a set of monitored endpoint instances
67- And 1 unmonitored endpoint instance
68- When the unmonitored endpoint instance is not sending heartbeats
69- Then the menu item badge is not displayed
70- */
68+ await waitFor ( async ( ) => {
69+ const heartbeatMenuItem = await queryHeartbeatMenuItem ( ) ;
70+
71+ expect ( heartbeatMenuItem && ! heartbeatMenuItem . isCounterVisible ) . toBeTruthy ( ) ;
72+ expect ( heartbeatMenuItem && heartbeatMenuItem . counterValue ) . toBe ( 0 ) ;
73+ } ) ;
74+ } ) ;
7175 } ) ;
7276} ) ;
0 commit comments