mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 03:11:01 -06:00
Alerting: use "find" to wait for expression editor to load (#50602)
This commit is contained in:
parent
99db588919
commit
5539bb4578
@ -148,19 +148,21 @@ describe('RuleEditor', () => {
|
||||
|
||||
await renderRuleEditor();
|
||||
await waitFor(() => expect(mocks.searchFolders).toHaveBeenCalled());
|
||||
|
||||
await waitFor(() => expect(mocks.api.discoverFeatures).toHaveBeenCalled());
|
||||
await userEvent.type(await ui.inputs.name.find(), 'my great new rule');
|
||||
await userEvent.click(await ui.buttons.lotexAlert.get());
|
||||
|
||||
await userEvent.click(await ui.buttons.lotexAlert.find());
|
||||
|
||||
const dataSourceSelect = ui.inputs.dataSource.get();
|
||||
await userEvent.click(byRole('combobox').get(dataSourceSelect));
|
||||
await clickSelectOption(dataSourceSelect, 'Prom (default)');
|
||||
await waitFor(() => expect(mocks.api.fetchRulerRules).toHaveBeenCalled());
|
||||
|
||||
await userEvent.type(await ui.inputs.expr.find(), 'up == 1');
|
||||
|
||||
await userEvent.type(ui.inputs.name.get(), 'my great new rule');
|
||||
await clickSelectOption(ui.inputs.namespace.get(), 'namespace2');
|
||||
await clickSelectOption(ui.inputs.group.get(), 'group2');
|
||||
|
||||
await userEvent.type(ui.inputs.expr.get(), 'up == 1');
|
||||
|
||||
await userEvent.type(ui.inputs.annotationValue(0).get(), 'some summary');
|
||||
await userEvent.type(ui.inputs.annotationValue(1).get(), 'some description');
|
||||
|
||||
@ -353,7 +355,7 @@ describe('RuleEditor', () => {
|
||||
await clickSelectOption(ui.inputs.namespace.get(), 'namespace2');
|
||||
await clickSelectOption(ui.inputs.group.get(), 'group2');
|
||||
|
||||
await userEvent.type(ui.inputs.expr.get(), 'up == 1');
|
||||
await userEvent.type(await ui.inputs.expr.find(), 'up == 1');
|
||||
|
||||
// TODO remove skipPointerEventsCheck once https://github.com/jsdom/jsdom/issues/3232 is fixed
|
||||
await userEvent.click(ui.buttons.addLabel.get(), { pointerEventsCheck: PointerEventsCheckLevel.Never });
|
||||
|
Loading…
Reference in New Issue
Block a user