1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2024-12-25 00:11:36 +01:00

Fix tests

This commit is contained in:
Aleksandr Gumroian 2024-10-02 13:16:37 +02:00
parent 87c81a2a2d
commit 0099759279
No known key found for this signature in database
GPG Key ID: 9E77849C64F0A733

View File

@ -43,14 +43,17 @@ describe("AlertContext", () => {
expect(componentContainer).toMatchSnapshot();
});
it("should dismiss alert with alert button", () => {
it("should dismiss alert with alert button", async () => {
fireEvent.click(getByText(componentContainer, "Set alert"));
// Alert is present
expect(getByText(componentContainer, "Alert content")).toBeDefined();
fireEvent.click(componentContainer.querySelector(".btn-close"));
// Alert is gone
expect(queryByText(componentContainer, "Alert content")).toBeNull();
await (() =>
expect(
queryByText(componentContainer, "Alert content")
).toBeNull());
});
it("should dismiss alert with external button", () => {