move away from ehemer to resolve recursive loop.
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user