Skip to content

Test case for the issue 280 #284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 16, 2022
Merged

Conversation

meirka
Copy link
Contributor

@meirka meirka commented Feb 12, 2022

No description provided.

const subject = await render(MainComponent, {imports: [AppRoutingModule, RouterTestingModule]});
await subject.navigate('/');

expect(await screen.findByText('Navigate')).toBeTruthy();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left extra expects in place, showing that there is successful navigation to second page.
I typically don't do that in my tests, please let me know if you want me to remove extras.

Thank you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, thanks!

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for creating this PR!

I left some comments to make it consistent with the rest of the tests.
Could you have a look at them please? You can take your time for it, there's no rush.

const subject = await render(MainComponent, {imports: [AppRoutingModule, RouterTestingModule]});
await subject.navigate('/');

expect(await screen.findByText('Navigate')).toBeTruthy();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, thanks!

@meirka
Copy link
Contributor Author

meirka commented Feb 14, 2022

left some comments to make it consistent with the rest of the test

No problem, made changes, let me know what you think.

Thanks!

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@timdeschryver
Copy link
Member

@all-contributors please add @meirka for bug, tests

@allcontributors
Copy link
Contributor

@timdeschryver

I've put up a pull request to add @meirka! 🎉

@timdeschryver
Copy link
Member

Oh yikes, it seems to be failing 😲

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to bother again, but could you comment this test out and make a new one that succeeds by using the following technique.

  const router = TestBed.inject(Router);
  router.initialNavigation();

And a tip, instead of toBeTruthy you can use toBeInTheDocument which makes it easier to read imho.

@meirka
Copy link
Contributor Author

meirka commented Feb 14, 2022

Sorry to bother again, but could you comment this test out and make a new one that succeeds by using the following technique.

  const router = TestBed.inject(Router);
  router.initialNavigation();

And a tip, instead of toBeTruthy you can use toBeInTheDocument which makes it easier to read imho.

Sure, I can do that, but what's purpose?
Is it just to pass the build?

@timdeschryver
Copy link
Member

@meirka yea 😅

@meirka
Copy link
Contributor Author

meirka commented Feb 14, 2022

Sure, will do

@meirka
Copy link
Contributor Author

meirka commented Feb 14, 2022

Done, let know if anything else, don't hesitate.
PS: don't forget to include me into fix PR. Im curious.

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again 🤗
I will ping you, and I hope to get this done next week.

@meirka
Copy link
Contributor Author

meirka commented Feb 16, 2022

Thanks again 🤗 I will ping you, and I hope to get this done next week.

Thank you for all the help, it was a pleasure!

@timdeschryver timdeschryver merged commit b349939 into testing-library:main Feb 16, 2022
@github-actions
Copy link

🎉 This PR is included in version 11.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants