Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

[WIP] docs(testing): new chapter, new samples #2198

Merged
merged 1 commit into from
Sep 13, 2016

Conversation

wardbell
Copy link
Contributor

WIP Do not merge
Totally revised testing chapter for RC5 and beyond.

@wardbell wardbell force-pushed the docs-testing-fresh-start branch 4 times, most recently from a790880 to 12c67c6 Compare August 26, 2016 22:06
@wardbell wardbell force-pushed the docs-testing-fresh-start branch 5 times, most recently from 1622aac to adf52e9 Compare September 1, 2016 07:24
@wardbell wardbell changed the title [WIP] docs(testing): new chapter, new samples ... for RC5+ [WIP] docs(testing): new chapter, new samples for RC6 Sep 1, 2016
@wardbell wardbell force-pushed the docs-testing-fresh-start branch 2 times, most recently from 7b35764 to 5fd3c4d Compare September 2, 2016 00:28
@wardbell wardbell force-pushed the docs-testing-fresh-start branch 14 times, most recently from 9526756 to 78b29ff Compare September 6, 2016 07:43
:marked
# Introduction to Angular Testing

You write tests to explore and confirm the behavior of parts of our application.
Copy link
Member

Choose a reason for hiding this comment

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

s/our/your?

@juliemr
Copy link
Member

juliemr commented Sep 8, 2016

system-config-extras doesn't seem to be loading properly, I don't know the setup of .io enough to know if this is a real issue :)

@juliemr
Copy link
Member

juliemr commented Sep 8, 2016

In a lot of places where you say "test class" when discussing what the TestBed creates, I think it would be clearer to say "test component".

Ward sez: Great idea. Fixed

@juliemr
Copy link
Member

juliemr commented Sep 8, 2016

In the AutoDetect spec, it would be helpful to show the imports so the user can see where ComponentFixtureAutoDetect comes from.

Ward sez: I am conflicted about this. I deliberately left out all import statements so that people can focus on the code and the ideas. I feel this is OK because the full code is readily available in the plunkers.

I could be persuaded to change my mind. But including all the imports will often almost double the example size and I'm not keen on that. Thinking.

@juliemr
Copy link
Member

juliemr commented Sep 8, 2016

fixture.whenStable pops up without introduction when it's first used, maybe we should add an intro for it.

EDIT: nevermind, I see the follow-up commentary.

1. Test it as a stand-alone component
1. Test it as used by a substitute for `DashboardHeroComponent`

A quick look at the `DashboardHeroComponent` constructor discourages the first approach:
Copy link
Member

Choose a reason for hiding this comment

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

DashboardComponent

@wardbell
Copy link
Contributor Author

@Foxandxss and @juliemr Thanks for your feedback. I believe I have incorporated all of it. My only point of disagreement is about whether to show import statements in the extracts.

As I explained above, I am reluctant to do so because I feel that it distracts from the code. Someone who wants to know where those thing actually come from can see that in a heartbeat by looking at the full code in the plunker.

I don't know that I'm "right" about this choice. I can only say that I think I have a good reason. Let's see what our audience thinks.

Thanks so much!

p.s.: I know this is incomplete. I have many more sections to go. I hope it is a good enough start.

@wardbell wardbell force-pushed the docs-testing-fresh-start branch 2 times, most recently from b06a892 to a89ecf7 Compare September 10, 2016 04:13
@juliemr
Copy link
Member

juliemr commented Sep 12, 2016

One more comment - this implies that async and fakeAsync are tied to the TestBed, which isn't true. async and fakeAsync are completely distinct from the test module and its setup, and can be used without it, or vice versa. I think the section labeled TestBed API should probably be called Angular Test Helper API or something of the sort.

@juliemr
Copy link
Member

juliemr commented Sep 12, 2016

Other than that, this looks like a great start to me!

@wardbell wardbell force-pushed the docs-testing-fresh-start branch 3 times, most recently from e633c67 to a7c1248 Compare September 13, 2016 18:18
@wardbell wardbell force-pushed the docs-testing-fresh-start branch from a7c1248 to 8a03ad3 Compare September 13, 2016 21:10
@wardbell wardbell changed the title [WIP] docs(testing): new chapter, new samples for RC6 [WIP] docs(testing): new chapter, new samples Sep 13, 2016
@wardbell wardbell merged commit 07cfce7 into angular:master Sep 13, 2016
@wardbell wardbell deleted the docs-testing-fresh-start branch September 13, 2016 21:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants