You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently upgraded our React-based app to using DeckGL 9.0.8 following the upgrade guide in the docs. The application itself works, but one of our test suites now fails with the following error:
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Check the render method of `FloorPlanMap`
FloorPlanMap is a React functional component that includes the DeckGL React component. We are testing our component with Jest/RTL using the RTL render method. We've tried adjusting imports, which is usually where you see this error.
Everything worked and all tests passed when we were using the latest DeckGL 8. Has anyone else run into this issue after upgrading to DeckGL 9?
Flavors
Script tag
React
Python/Jupyter notebook
MapboxOverlay
GoogleMapsOverlay
CartoLayer
ArcGIS
Expected Behavior
No response
Steps to Reproduce
import DeckGL from "deck.gl";
<DeckGL layers={[<insert layers here, though this error occurs even if this is empty>]}></DeckGL>
This code works fine in the application with no errors/issues, however when rendering it in a .test.tsx file using jest and react testing library , this error is seen:
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Example of test:
import { render } from "@testing-library/react";
it("should render the map and table", async () => {
const { container } = render(<FloorplanMap/>);
const map = container?.querySelector("#floorPlanMap");
expect(map).toBeInTheDocument();
expect(map?.tagName).toBe("CANVAS");
});
We are using "jsdom" for our test environment in our jest config file.
Description
We recently upgraded our React-based app to using DeckGL 9.0.8 following the upgrade guide in the docs. The application itself works, but one of our test suites now fails with the following error:
FloorPlanMap is a React functional component that includes the DeckGL React component. We are testing our component with Jest/RTL using the RTL render method. We've tried adjusting imports, which is usually where you see this error.
Everything worked and all tests passed when we were using the latest DeckGL 8. Has anyone else run into this issue after upgrading to DeckGL 9?
Flavors
Expected Behavior
No response
Steps to Reproduce
This code works fine in the application with no errors/issues, however when rendering it in a .test.tsx file using jest and react testing library , this error is seen:
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Example of test:
We are using "jsdom" for our test environment in our jest config file.
Environment
Logs
No response
The text was updated successfully, but these errors were encountered: