Skip to content
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

docs: RouterTestingModule should be added to Testing guide #34341

Open
Splaktar opened this issue Dec 11, 2019 · 9 comments
Open

docs: RouterTestingModule should be added to Testing guide #34341

Splaktar opened this issue Dec 11, 2019 · 9 comments

Comments

@Splaktar
Copy link
Member

@Splaktar Splaktar commented Dec 11, 2019

📚 Docs or angular.io bug report

Description

The Testing Guide has the following "helpful" alert:

A future guide update will explain how to write such tests with the RouterTestingModule.

This was added as part of PR #20697 in 2017. Since this hasn't been addressed yet, I figured it would be a good idea to open an issue to ensure that it gets documented.

There are some minimal RouterTestingModule API docs but they are not sufficient. This is something that really needs to be included in the Testing Guide. Both for Services that cause routing and components.

🔬 Minimal Reproduction

What's the affected URL?**

Guide: https://angular.io/guide/testing#what-good-are-these-tests
Source: https://github.com/angular/angular/blame/fe4447d56860c55000bc7424a61462b6de8596e5/aio/content/guide/testing.md#L2250-L2251

@kapunahelewong
Copy link
Contributor

@kapunahelewong kapunahelewong commented Dec 11, 2019

Agreed on the "helpful" note. According to guidelines it's ideal for documentation not to make references to what "should" come in the future. Instead, we're supposed to stick with what we're documenting in the present moment.

Note for docs team: when this becomes a PR, we'll need to remove this note and sweep for any other future-related notes in there.

@kapunahelewong kapunahelewong added this to Pending - Top of backlog in docs Jan 6, 2020
@ajitsinghkaler
Copy link
Contributor

@ajitsinghkaler ajitsinghkaler commented Mar 9, 2020

@kapunahelewong can I take this issue

@kapunahelewong
Copy link
Contributor

@kapunahelewong kapunahelewong commented Mar 10, 2020

Yes, @ajitsinghkaler, thank you!! Please let me know if you need help with any of the issues you've volunteered for. 🌟

@LayZeeDK
Copy link
Contributor

@LayZeeDK LayZeeDK commented Jun 9, 2020

The alert seems to be directly related to the preceding paragraph:

A different battery of tests can explore whether the application navigates as expected in the presence of conditions that influence guards such as whether the user is authenticated and authorized.

What's the scope for this issue? Adding a guide for different types of tests using the RouterTestingModule or only integration tests exercising conditions affected by route guards?

@kapunahelewong
Copy link
Contributor

@kapunahelewong kapunahelewong commented Jun 10, 2020

Good questions, @LayZeeDK. These are exactly the kinds of questions we are discussing with in the docs team as we rework a lot of the documentation. Do you have any particular thoughts on the scope and types of example tests that you'd be interested in? If you search for something regarding testing what are the topics that first come to mind? Your use cases would also be interesting to hear. If you or others would like to log your thoughts here in this issue I'd be happy to link to this issue from the Jira as context for the writer.

@LayZeeDK
Copy link
Contributor

@LayZeeDK LayZeeDK commented Jun 10, 2020

Different types of tests involving the RouterTestingModule:

  • Testing routed components
  • Testing routing components
  • Testing route guards
  • Testing route resolvers
  • Integration testing routed feature modules
  • Integration testing routed feature modules with route guards
  • Integration testing a routed component with nested routes
  • Integration testing a routed component with route resolvers
@LayZeeDK
Copy link
Contributor

@LayZeeDK LayZeeDK commented Jun 10, 2020

I've been intensively looking into this 3 year old issue for the past week:
#15779

I feel more and more convinced that for the most part we don't need to extend our testing APIs to close it, but rather write a guide covering the types of tests listed above.

@kapunahelewong
Copy link
Contributor

@kapunahelewong kapunahelewong commented Jun 15, 2020

Thank you, @LayZeeDK! I've added this and #15779 to the Jira work item so the writer who works on it can refer back for context.

Docs team: See https://angular-team.atlassian.net/browse/DOCS-784

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
docs
Pending - Top of backlog
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.