solid-testing-library icon indicating copy to clipboard operation
solid-testing-library copied to clipboard

location option ignored

Open tslocke opened this issue 7 months ago • 23 comments

This might be related to #60 - I'm also using vitest.

The following test fails:

import { render, screen} from '@solidjs/testing-library'
import { Route, Router } from "@solidjs/router"

test.only('render location', async () => {
  render(Component, {location: '/foo'})
  expect(await screen.findByText('foo')).toBeTruthy()
})

function Component() {
  return (
    <Router>
      <Route path='/' component={() => <p>root</p>}/>
      <Route path='/foo' component={() => <p>foo</p>}/>
    </Router>
  )
}

If I change the findByText to 'root' it passes. Am I using the API correctly?

tslocke avatar Jul 17 '24 12:07 tslocke