move away from ehemer to resolve recursive loop.

This commit is contained in:
Jordan Hewitt
2024-06-28 14:53:48 -07:00
parent 3d03f1d9e8
commit 93c0c25eb5
12 changed files with 309 additions and 160 deletions

View File

@ -1,10 +1,8 @@
import { renderWithProviders } from "@/lib/rendering";
import { ProductEditor } from "@/components/ProductEditor";
import {products as fixtures} from "../../__fixtures__/initialProducts";
import React from "react";
import { useAppSelector } from "@/app/store";
import { selectProducts } from "@/features/product/productSlice";
import {products as fixtures} from "@/__fixtures__/initialProducts";
import { screen } from "@testing-library/react-native";
import { selectProducts } from "@/features/product/productSlice";
describe("ProductEditor", () => {
it("renders correctly", async () => {
@ -12,7 +10,11 @@ describe("ProductEditor", () => {
products: fixtures,
});
const products = store.getState();
const state1 = store.getState();
const products = selectProducts(state1);
expect(products).toHaveLength(6);
// Check if the product names are rendered
expect(screen.getByText(products[0].attributes.name as string)).toBeTruthy();