question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support client side navigation

See original GitHub issue

🚀 Feature Proposal

Support client side page navigation, e.g. Link and programatic navigation using router. This would make this library extremely useful for integration testing of NextJS applications.

Since this library is mocking the router, it is in full control over that and has access to handlers, right? In that case I assume this should be possible.

Example

describe('Blog page', () => {
  it('renders blog page', async () => {
    const Page = await getPage({
      route: '/blog/1',
    });

    render(Page);
    userEvent.click(screen.getByText('Link'))

    await screen.findByText('Linked page')
  });
});

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
Meemawcommented, Nov 20, 2020

Great work @toomuchdesign 👍 I will test it locally on a real world application this weekend.

0reactions
toomuchdesigncommented, Nov 21, 2020

Sounds great @Meemaw!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get client-side navigation right - DEV Community ‍ ‍
Classic navigation has support for scroll restoration: When the user navigates back or forward, the browser will restore the scroll position.
Read more >
Client-Side Navigation - Navigate Between Pages - Next.js
Client -side navigation means that the page transition happens using JavaScript, which is faster than the default navigation done by the browser. Here's...
Read more >
Modern client-side routing: the Navigation API
First is programmatic navigation, where navigation is caused by a method call inside your client-side code. You can call navigation.navigate('/another_page') ...
Read more >
client-side-navigation in angular - liveBook · Manning
Arrange the client-side navigation using the powerful router ... Angular includes many classes supporting navigation—for example, Router , Route , Routes ...
Read more >
Next.js - Client Side Navigation vs. changes in html
Here is how I understand it: The approach Next.js takes for client-side navigation is a mixture of SPA-style navigation and traditional ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found