27 lines
825 B
TypeScript
27 lines
825 B
TypeScript
import { Product } from "@/lib/product"
|
|
import ProductAttributeEditor from "../ProductAttributeEditor"
|
|
import { renderWithProviders } from "./util"
|
|
import { area } from "enheter"
|
|
import {screen} from '@testing-library/react-native';
|
|
import React from "react";
|
|
|
|
describe("Product editor tests", () => {
|
|
it("Product attributes render", () => {
|
|
const product = new Product(
|
|
100,
|
|
area("squareFoot", 4 * 7)
|
|
);
|
|
const onChange = jest.fn();
|
|
const onDelete = jest.fn();
|
|
renderWithProviders(
|
|
<ProductAttributeEditor
|
|
key="Name"
|
|
value="product"
|
|
product={product}
|
|
onChange={onChange}
|
|
onDelete={onDelete}
|
|
/>);
|
|
expect(screen.findByLabelText("Delete Attribute")).not.toBeNull();
|
|
|
|
})
|
|
}) |