Skip to content

Commit

Permalink
Fix popover test (#3139)
Browse files Browse the repository at this point in the history
Fixes issues with flakey spec
  • Loading branch information
thestephenmarshall authored Feb 14, 2024
1 parent 410b48e commit 1848bf9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions playbook/app/pb_kits/playbook/pb_popover/popover.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { render, screen, fireEvent, waitForElementToBeRemoved } from "../utilities/test-utils";
import { render, screen, fireEvent } from "../utilities/test-utils";
import { Button, PbReactPopover } from "..";

const testId = "popover-kit";
Expand Down Expand Up @@ -192,7 +192,7 @@ const PopoverTestClicktoClose3 = () => {
expect(kit).toBeInTheDocument();
fireEvent.click(document.body);

waitForElementToBeRemoved(screen.findByText('Click Anywhere'))
expect(kit).not.toBeInTheDocument;
});

test("closes Popover on click inside", async () => {
Expand All @@ -203,7 +203,7 @@ const PopoverTestClicktoClose3 = () => {
expect(kit).toBeInTheDocument();
fireEvent.click(kit);

waitForElementToBeRemoved(screen.findByText('Click Anywhere'))
expect(kit).not.toBeInTheDocument;
});

test("closes Popover on click outside", async () => {
Expand All @@ -216,5 +216,5 @@ const PopoverTestClicktoClose3 = () => {
expect(kit).toBeInTheDocument();
fireEvent.click(btn);

waitForElementToBeRemoved(screen.findByText('Click Outside'))
expect(kit).not.toBeInTheDocument;
});

0 comments on commit 1848bf9

Please # to comment.