Skip to content

Commit

Permalink
Plugin E2E:: Add back health check mock (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunker authored Feb 12, 2024
1 parent d18b33e commit fc17944
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/plugin-e2e/src/models/DataSourceConfigPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ export class DataSourceConfigPage extends GrafanaPage {
* @param json the json response to return
* @param status the HTTP status code to return. Defaults to 200
*/
async mockHealthCheckResponse<T = any>(json: T, status = 200) {}
async mockHealthCheckResponse<T = any>(json: T, status = 200) {
await this.ctx.page.route(
`${this.ctx.selectors.apis.DataSource.health(this.datasource.uid, this.datasource.id?.toString() ?? '')}`,
async (route) => {
await route.fulfill({ json, status });
}
);
}

/**
* Clicks the save and test button and waits for the response
Expand Down

0 comments on commit fc17944

Please sign in to comment.