Fix AvatarField

Change-Id: I9614163942fcb8667885b524caf944500605c55d
This commit is contained in:
Manuel Stahl
2024-02-07 13:30:02 +01:00
parent 3fe0e95069
commit 5b8882bd80
2 changed files with 29 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
import React from "react";
import { RecordContextProvider } from "react-admin";
import { render, screen } from "@testing-library/react";
import AvatarField from "./AvatarField";
describe("AvatarField", () => {
it("shows image", () => {
const value = {
avatar: "foo",
};
render(
<RecordContextProvider value={value}>
<AvatarField source="avatar" />
</RecordContextProvider>
);
expect(screen.getByRole("img").getAttribute("src")).toBe("foo");
});
});