/* eslint-env jest */

import "@testing-library/jest-dom/extend-expect";
import { cleanup } from "@testing-library/react";

import Notification from "../Notify";

afterEach(cleanup);

test("Smoke", async () => {
  expect(Notification).toBeDefined();
});

test("Basic", async () => {
  const config = {
    title: "Test",
    message: "This is a test notification",
  };

  Notification.send({ ...config });

  // Give some time for notification to animate in frame
  setTimeout(() => {
    expect(document.querySelector('[data-testid="notification"]').length).toBe(
      1,
    );
  }, 10);
});
