-
Notifications
You must be signed in to change notification settings - Fork 93
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
Conversation
const subject = await render(MainComponent, {imports: [AppRoutingModule, RouterTestingModule]}); | ||
await subject.navigate('/'); | ||
|
||
expect(await screen.findByText('Navigate')).toBeTruthy(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, thanks!
There was a problem hiding this 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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, thanks!
No problem, made changes, let me know what you think. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
@all-contributors please add @meirka for bug, tests |
I've put up a pull request to add @meirka! 🎉 |
Oh yikes, it seems to be failing 😲 |
There was a problem hiding this 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.
Sure, I can do that, but what's purpose? |
@meirka yea 😅 |
Sure, will do |
Done, let know if anything else, don't hesitate. |
There was a problem hiding this 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.
Thank you for all the help, it was a pleasure! |
🎉 This PR is included in version 11.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.