I successfully created 8 tests, all on the same file, for one of my projects. They all run, they all pass.
However, I just added a new test file to test a separate component.
I must be missing something.
I am aware of the cleanup()
function, but I am NOT using it due to this article by Kent C. Dodds himself who says the cleanup is now automatic. Article here.
Error is:
console.error
Warning: Invalid DOM property `inputmode`. Did you mean `inputMode`?
at input
at CcLogic (...creditCardLogic.js:25:34)
Why would a test work until a new file is created?
The test it is complaining about is:
test('mastercard logo displays if typing 25', async () => {
const { container } = render(<CcLogic fieldId={"cc-field"} />)
const input = screen.getByPlaceholderText('Ex: 4502783790218767')
fireEvent.change(input, {target: {value: '25'}})
const svgIcon = container.querySelector('.fa-cc-mastercard')
expect(svgIcon).toBeInTheDocument()
})