MCPcopy
hub / github.com/TanStack/router / checkPostsLink

Function checkPostsLink

packages/react-router/tests/link.test.tsx:5637–5645  ·  view source on GitHub ↗
(root: string)

Source from the content-addressed store, hash-verified

5635 expect(searchValue).toHaveTextContent(value)
5636 }
5637 async function checkPostsLink(root: string) {
5638 const postsLink = await screen.findByRole('link', { name: 'Posts' })
5639 expect(postsLink).toHaveAttribute('href')
5640 const href = postsLink.getAttribute('href')
5641 const search = getSearchParamsFromURI(href!)
5642 expect(search.size).toBe(2)
5643 expect(search.get('page')).toBe('123')
5644 expect(search.get('root')).toBe(root)
5645 }
5646 await checkSearchValue('abc')
5647 await checkPostsLink('abc')
5648

Callers 1

link.test.tsxFile · 0.70

Calls 3

getSearchParamsFromURIFunction · 0.90
getAttributeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected