My Jest test file includes a simple import of a TSX component in my nextjs 13 project. However, when I try to use the component as a TSX tag, an error occurs:
"'Properties' refers to a value, but is being used as a type here. Did you mean 'typeof Properties'?ts(2749)"
Furthermore, the import itself displays another error:
"'Properties' is declared but its value is never read.ts(6133) "
Interestingly, if I don't use the TSX syntax by omitting the opening and closing < />, the Properties import works fine. The import seems to be correct as it has the signature of a TypeScript JSX.Element. What could be causing this issue?
import { render, screen } from '@testing-library/react'
import Properties from "../src/app/[locale]/properties/page"
import '@testing-library/jest-dom'
describe("PropertiesPage", () => {
it("renders a results page", () => {
const meme = render(<Properties/>) // < fails to recognise import
})
})