[Synthetics] adjust alert toggle test (#134374) (#134460)

* synthetics - adjust alert toggle test

* Update x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.test.tsx

* Update toggle_alert_flyout_button.test.tsx

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit fb238214f8)

Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
This commit is contained in:
Kibana Machine 2022-06-15 10:30:31 -04:00 committed by GitHub
parent 94d89a832f
commit 98e4bfd4b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,15 +29,16 @@ describe('ToggleAlertFlyoutButtonComponent', () => {
});
it("does not contain a tooltip explaining why the user can't create alerts", async () => {
const { getByText, findByText } = render(
const { getByText, queryByText } = render(
<ToggleAlertFlyoutButtonComponent setAlertFlyoutVisible={jest.fn()} />,
{ core: makeUptimePermissionsCore({ save: true }) }
);
userEvent.click(getByText('Alerts and rules'));
userEvent.hover(getByText(ToggleFlyoutTranslations.openAlertContextPanelLabel));
await expect(() =>
findByText('You need read-write access to Uptime to create alerts in this app.')
).rejects.toEqual(expect.anything());
await new Promise((r) => setTimeout(r, 250)); // wait for the default time for tooltips to show up
await expect(
queryByText('You need read-write access to Uptime to create alerts in this app.')
).not.toBeInTheDocument();
});
});