-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for the heartbeats filter box
- Loading branch information
Showing
13 changed files
with
251 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
src/Frontend/test/specs/heartbeats/actions/navigateToHeartbeatsConfiguration.ts
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/Frontend/test/specs/heartbeats/actions/navigateToHeartbeatsTabs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { screen } from "@testing-library/vue"; | ||
|
||
export async function navigateToHeartbeatsConfiguration() { | ||
const configurationTab = await screen.findByRole("tab", { name: "Configuration" }); | ||
configurationTab.click(); | ||
|
||
// Wait for the tab to switch | ||
await screen.findByRole("region", { name: "Endpoint Configuration" }); | ||
} | ||
|
||
export async function navigateToHealthyHeartbeats() { | ||
const healthyHeartbeatsTab = await screen.findByRole("tab", { name: /Healthy Endpoints \(\d+\)/i }); | ||
healthyHeartbeatsTab.click(); | ||
|
||
// Wait for the tab to switch | ||
await screen.findByRole("region", { name: "Healthy Endpoints" }); | ||
} | ||
|
||
export async function navigateToUnHealthyHeartbeats() { | ||
const unhealthyHeartbeatsTab = await screen.findByRole("tab", { name: /Unhealthy Endpoints \(\d+\)/i }); | ||
unhealthyHeartbeatsTab.click(); | ||
|
||
// Wait for the tab to switch | ||
await screen.findByRole("region", { name: "Unhealthy Endpoints" }); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Frontend/test/specs/heartbeats/actions/setHeartbeatFilter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { screen } from "@testing-library/vue"; | ||
import UserEvent from "@testing-library/user-event"; | ||
|
||
export async function setHeartbeatFilter(filterText: string) { | ||
const filterBox = <HTMLInputElement>await screen.findByRole("searchbox", { name: "filter by name" }); | ||
|
||
if (filterText.length > 0) { | ||
await UserEvent.type(filterBox, filterText); | ||
} else { | ||
await UserEvent.clear(filterBox); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/Frontend/test/specs/heartbeats/actions/toggleHeartbeatMonitoring.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { screen, within } from "@testing-library/vue"; | ||
|
||
export async function toggleHeartbeatMonitoring(instanceName: string) { | ||
const endpointRow = await screen.findByRole("row", { name: instanceName }); | ||
|
||
(<HTMLInputElement>within(endpointRow).getByRole("checkbox", { hidden: true })).click(); | ||
} |
Oops, something went wrong.