import React from "react"; import { render, screen } from "@testing-library/react"; import { describe, expect, it } from "bun:test"; import ImageModerator from '../../src/components/ImageModerator/ImageModerator'; it("should render into the document", () => { render(); }); it("should show a new image when accept button is clicked", () => { const acceptButton = screen.getByText("Accept"); const imgElement = screen.getByRole("img"); const imgElementSrcBefore = imgElement.getAttribute("src"); acceptButton.click() expect(imgElement.getAttribute("src")).not.toEqual(imgElementSrcBefore); }); it("should show a new image when discard button is clicked", () => { const discardButton = screen.getByText("Discard"); const imgElement = screen.getByRole("img"); const imgElementSrcBefore = imgElement.getAttribute("src"); discardButton.click() expect(imgElement.getAttribute("src")).not.toEqual(imgElementSrcBefore); });