From 47b6dc228747bb12e53ef1efd72b5db178349cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Mu=CC=88ller?= Date: Wed, 10 Aug 2016 08:42:53 +0200 Subject: [PATCH 1/8] fix(footer): Improve styleguide trigger positioning --- public/_includes/_footer.jade | 2 +- public/resources/css/module/_footer.scss | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/public/_includes/_footer.jade b/public/_includes/_footer.jade index 7f77d739f3..a186b59ca8 100644 --- a/public/_includes/_footer.jade +++ b/public/_includes/_footer.jade @@ -53,5 +53,5 @@ else footer(class="background-steel") small.text-caption Powered by Google ©2010-2016. Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0. - a(aria-label="View Style Guide" href=styleguide title="Style Guide" class="styleguide-trigger text-snow" md-button) + a(aria-label="View Style Guide" href=styleguide title="Style Guide" class="styleguide-trigger text-snow") span.icon-favorite diff --git a/public/resources/css/module/_footer.scss b/public/resources/css/module/_footer.scss index d0376f476c..50ece15507 100644 --- a/public/resources/css/module/_footer.scss +++ b/public/resources/css/module/_footer.scss @@ -92,13 +92,17 @@ position: relative; .styleguide-trigger { - position: absolute; - top: $unit * 2; - right: $unit * 2; - font-size: 14px; - line-height: 20px; - padding: 0px $unit; opacity: .24; + float: right; + + @media handheld and (max-width: $phone-breakpoint), + screen and (max-device-width: $phone-breakpoint), + screen and (max-width: $tablet-breakpoint) { + display: block; + margin-top: 8px; + font-size: 18px; + float: none; + } } } -} \ No newline at end of file +} From 18dba19b8efaa7009007bb5969d42fb2b14c1940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Thu, 11 Aug 2016 23:15:50 +0200 Subject: [PATCH 2/8] Further improve styleguide trigger styles - Add some more space to the right on desktop - Remove `text-decoration` - Use correct `line-height` for the icon --- public/resources/css/module/_footer.scss | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/resources/css/module/_footer.scss b/public/resources/css/module/_footer.scss index 50ece15507..214ff89059 100644 --- a/public/resources/css/module/_footer.scss +++ b/public/resources/css/module/_footer.scss @@ -92,6 +92,8 @@ position: relative; .styleguide-trigger { + text-decoration: none; + margin-right: $unit * 2; opacity: .24; float: right; @@ -99,10 +101,15 @@ screen and (max-device-width: $phone-breakpoint), screen and (max-width: $tablet-breakpoint) { display: block; - margin-top: 8px; + margin-top: $unit; + margin-right: 0; font-size: 18px; float: none; } + + .icon-favorite { + line-height: 20px; + } } } } From 6c2ec829e5d0bf9ef9bc981197b47687ebc05747 Mon Sep 17 00:00:00 2001 From: Lars Gyrup Brink Nielsen Date: Tue, 6 Sep 2016 21:54:23 +0200 Subject: [PATCH 3/8] Fixed footer logo overflowing Footer logo was overflowing at ~960px wide viewport. Added `background-size: contain` (shorthand), and `max-width: 100%` to contain wrapper, and background image within grid. --- public/resources/css/module/_footer.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/resources/css/module/_footer.scss b/public/resources/css/module/_footer.scss index d0376f476c..fbaefe4172 100644 --- a/public/resources/css/module/_footer.scss +++ b/public/resources/css/module/_footer.scss @@ -27,9 +27,10 @@ } .logo-inverse-large { - background: url('/resources/images/logos/inverse/shield/shield-large.png') 0px 0px no-repeat; + background: url('/resources/images/logos/inverse/shield/shield-large.png') 0px 0px / contain no-repeat; height: 200px; width: 200px; + max-width: 100%; @media handheld and (max-width: $phone-breakpoint), screen and (max-device-width: $phone-breakpoint), @@ -101,4 +102,4 @@ opacity: .24; } } -} \ No newline at end of file +} From 8a4a80033e0a0cca49398581b1df5ec79fd5d108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Mu=CC=88ller?= Date: Wed, 21 Sep 2016 15:32:11 +0200 Subject: [PATCH 4/8] Fix up styles after sync --- public/_includes/_footer.jade | 2 +- public/resources/css/module/_footer.scss | 33 ++++++++++-------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/public/_includes/_footer.jade b/public/_includes/_footer.jade index 62a9e97016..efd8cde21a 100644 --- a/public/_includes/_footer.jade +++ b/public/_includes/_footer.jade @@ -53,5 +53,5 @@ else footer(class="background-midnight") small.text-caption Powered by Google ©2010-2016. Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0. - a(aria-label="View Style Guide" href=styleguide title="Style Guide" class="styleguide-trigger text-snow") + a(aria-label="View Style Guide" href=styleguide title="Style Guide" class="styleguide-trigger") span.icon-favorite diff --git a/public/resources/css/module/_footer.scss b/public/resources/css/module/_footer.scss index 14ab30a64c..5734ee69f3 100644 --- a/public/resources/css/module/_footer.scss +++ b/public/resources/css/module/_footer.scss @@ -77,33 +77,28 @@ } footer { - text-align: left; - padding: ($unit * 2) ($unit * 6); + text-align: center; + padding: $unit * 2; position: relative; .styleguide-trigger { - box-sizing: border-box; - position: absolute; - display: inline-block; - bottom: $unit * 2; - right: $unit * 2; - font-size: 14px; - line-height: 24px; - height: 24px; - margin: 0; - padding: 0 ($unit * 3); + color: $snow; + text-decoration: none; + margin-right: $unit * 2; opacity: .24; - transition: all .3s; + float: right; - &:hover { - background: $blue-grey-700; - text-decoration: none; + @include respond-to('mobile') { + display: block; + margin-top: $unit; + margin-right: 0; + font-size: 18px; + float: none; } .icon-favorite { - display: inline-block; - line-height: 24px; + line-height: 20px; } } } -} \ No newline at end of file +} From 9a338b659e1866abc2c147f5664e4c5040f83bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Mu=CC=88ller?= Date: Wed, 21 Sep 2016 16:11:12 +0200 Subject: [PATCH 5/8] Some more cleanup --- public/_includes/_footer.jade | 2 +- public/resources/css/module/_footer.scss | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/_includes/_footer.jade b/public/_includes/_footer.jade index efd8cde21a..1cb22a54d2 100644 --- a/public/_includes/_footer.jade +++ b/public/_includes/_footer.jade @@ -52,6 +52,6 @@ else li 中文版 footer(class="background-midnight") - small.text-caption Powered by Google ©2010-2016. Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0. + small.text-caption Powered by Google ©2010-2016. Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0. a(aria-label="View Style Guide" href=styleguide title="Style Guide" class="styleguide-trigger") span.icon-favorite diff --git a/public/resources/css/module/_footer.scss b/public/resources/css/module/_footer.scss index 5734ee69f3..5127bedcf2 100644 --- a/public/resources/css/module/_footer.scss +++ b/public/resources/css/module/_footer.scss @@ -78,20 +78,20 @@ footer { text-align: center; - padding: $unit * 2; - position: relative; + padding: ($unit * 2) ($unit * 6); + + a { + color: $snow; + } .styleguide-trigger { - color: $snow; text-decoration: none; - margin-right: $unit * 2; opacity: .24; float: right; @include respond-to('mobile') { display: block; margin-top: $unit; - margin-right: 0; font-size: 18px; float: none; } From c8b2c394098f9fe422ded1b4f28cfe7c30df418e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Mu=CC=88ller?= Date: Fri, 23 Sep 2016 08:58:06 +0200 Subject: [PATCH 6/8] Align footer text left on desktop --- public/resources/css/module/_footer.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/resources/css/module/_footer.scss b/public/resources/css/module/_footer.scss index 5127bedcf2..5bca0a6907 100644 --- a/public/resources/css/module/_footer.scss +++ b/public/resources/css/module/_footer.scss @@ -77,9 +77,13 @@ } footer { - text-align: center; + text-align: left; padding: ($unit * 2) ($unit * 6); + @include respond-to('mobile') { + text-align: center; + } + a { color: $snow; } From b478aaf7a2f7b7f3b66c30936a4e5a47ac5ef02a Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Fri, 23 Sep 2016 02:03:20 -0700 Subject: [PATCH 7/8] docs(testing): from Igor Minar feedback (Part 1) (#2450) --- .../testing/ts/app/banner.component.spec.ts | 41 +- .../ts/app/shared/title-case.pipe.spec.ts | 9 +- .../ts/app/shared/twain.component.spec.ts | 26 +- .../testing/ts/app/welcome.component.spec.ts | 70 ++-- public/docs/dart/latest/cookbook/_data.json | 2 +- public/docs/dart/latest/guide/_data.json | 14 +- public/docs/js/latest/cookbook/_data.json | 2 +- public/docs/js/latest/guide/_data.json | 14 +- public/docs/ts/latest/cookbook/_data.json | 2 +- public/docs/ts/latest/guide/_data.json | 14 +- public/docs/ts/latest/guide/testing.jade | 379 +++++++++--------- 11 files changed, 296 insertions(+), 277 deletions(-) diff --git a/public/docs/_examples/testing/ts/app/banner.component.spec.ts b/public/docs/_examples/testing/ts/app/banner.component.spec.ts index c9af53a805..3e7f967b82 100644 --- a/public/docs/_examples/testing/ts/app/banner.component.spec.ts +++ b/public/docs/_examples/testing/ts/app/banner.component.spec.ts @@ -11,7 +11,8 @@ import { BannerComponent } from './banner.component'; // #docregion setup let comp: BannerComponent; let fixture: ComponentFixture; -let el: DebugElement; +let de: DebugElement; +let el: HTMLElement; describe('BannerComponent', () => { beforeEach(() => { @@ -23,25 +24,27 @@ describe('BannerComponent', () => { comp = fixture.componentInstance; // BannerComponent test instance - // get title DebugElement by element name - el = fixture.debugElement.query(By.css('h1')); + // query for the title

by CSS element selector + de = fixture.debugElement.query(By.css('h1')); + el = de.nativeElement; + }); // #enddocregion setup // #docregion tests it('should display original title', () => { - fixture.detectChanges(); // trigger data binding - expect(el.nativeElement.textContent).toContain(comp.title); + fixture.detectChanges(); + expect(el.textContent).toContain(comp.title); }); it('should display a different test title', () => { comp.title = 'Test Title'; - fixture.detectChanges(); // trigger data binding - expect(el.nativeElement.textContent).toContain('Test Title'); + fixture.detectChanges(); + expect(el.textContent).toContain('Test Title'); }); // #enddocregion tests // #docregion test-w-o-detect-changes it('no title in the DOM until manually call `detectChanges`', () => { - expect(el.nativeElement.textContent).toEqual(''); + expect(el.textContent).toEqual(''); }); // #enddocregion test-w-o-detect-changes @@ -59,8 +62,7 @@ describe('BannerComponent with AutoChangeDetect', () => { fixture = TestBed.configureTestingModule({ declarations: [ BannerComponent ], providers: [ - { provide: ComponentFixtureAutoDetect, - useValue: true } + { provide: ComponentFixtureAutoDetect, useValue: true } ] }) // #enddocregion auto-detect @@ -68,27 +70,28 @@ describe('BannerComponent with AutoChangeDetect', () => { comp = fixture.componentInstance; // BannerComponent test instance - // find title DebugElement by element name - el = fixture.debugElement.query(By.css('h1')); + // query for the title

by CSS element selector + de = fixture.debugElement.query(By.css('h1')); + el = de.nativeElement; }); // #docregion auto-detect-tests it('should display original title', () => { // Hooray! No `fixture.detectChanges()` needed - expect(el.nativeElement.textContent).toContain(comp.title); + expect(el.textContent).toContain(comp.title); }); it('should still see original title after comp.title change', () => { const oldTitle = comp.title; comp.title = 'Test Title'; // Displayed title is old because Angular didn't hear the change :( - expect(el.nativeElement.textContent).toContain(oldTitle); + expect(el.textContent).toContain(oldTitle); }); it('should display updated title after detectChanges', () => { comp.title = 'Test Title'; fixture.detectChanges(); // detect changes explicitly - expect(el.nativeElement.textContent).toContain(comp.title); + expect(el.textContent).toContain(comp.title); }); // #enddocregion auto-detect-tests }); @@ -114,14 +117,14 @@ describe('BannerComponent (simpified)', () => { // #docregion simple-example-it it('should display original title', () => { - // trigger data binding to update the view + // trigger change detection to update the view fixture.detectChanges(); - // find the title element in the DOM using a CSS selector - el = fixture.debugElement.query(By.css('h1')); + // query for the title

by CSS element selector + de = fixture.debugElement.query(By.css('h1')); // confirm the element's content - expect(el.nativeElement.textContent).toContain(comp.title); + expect(de.nativeElement.textContent).toContain(comp.title); }); // #enddocregion simple-example-it }); diff --git a/public/docs/_examples/testing/ts/app/shared/title-case.pipe.spec.ts b/public/docs/_examples/testing/ts/app/shared/title-case.pipe.spec.ts index 7481537c10..5dfc5d91b0 100644 --- a/public/docs/_examples/testing/ts/app/shared/title-case.pipe.spec.ts +++ b/public/docs/_examples/testing/ts/app/shared/title-case.pipe.spec.ts @@ -2,14 +2,15 @@ // #docregion import { TitleCasePipe } from './title-case.pipe'; -// #docregion excerpt +// #docregion excerpt, mini-excerpt describe('TitleCasePipe', () => { - // This pipe is a pure function so no need for BeforeEach + // This pipe is a pure, stateless function so no need for BeforeEach let pipe = new TitleCasePipe(); it('transforms "abc" to "Abc"', () => { expect(pipe.transform('abc')).toBe('Abc'); }); +// #enddocregion mini-excerpt it('transforms "abc def" to "Abc Def"', () => { expect(pipe.transform('abc def')).toBe('Abc Def'); @@ -28,6 +29,6 @@ describe('TitleCasePipe', () => { it('transforms " abc def" to " Abc Def" (preserves spaces) ', () => { expect(pipe.transform(' abc def')).toBe(' Abc Def'); }); -// #docregion excerpt +// #docregion excerpt, mini-excerpt }); -// #enddocregion excerpt +// #enddocregion excerpt, mini-excerpt diff --git a/public/docs/_examples/testing/ts/app/shared/twain.component.spec.ts b/public/docs/_examples/testing/ts/app/shared/twain.component.spec.ts index 767e1ec2ca..b80993cc0b 100644 --- a/public/docs/_examples/testing/ts/app/shared/twain.component.spec.ts +++ b/public/docs/_examples/testing/ts/app/shared/twain.component.spec.ts @@ -12,7 +12,8 @@ describe('TwainComponent', () => { let fixture: ComponentFixture; let spy: jasmine.Spy; - let twainEl: DebugElement; // the element with the Twain quote + let de: DebugElement; + let el: HTMLElement; let twainService: TwainService; // the actually injected service const testQuote = 'Test Quote'; @@ -37,54 +38,53 @@ describe('TwainComponent', () => { // #enddocregion spy // Get the Twain quote element by CSS selector (e.g., by class name) - twainEl = fixture.debugElement.query(By.css('.twain')); + de = fixture.debugElement.query(By.css('.twain')); + el = de.nativeElement; }); // #enddocregion setup // #docregion tests - function getQuote() { return twainEl.nativeElement.textContent; } - it('should not show quote before OnInit', () => { - expect(getQuote()).toBe('', 'nothing displayed'); + expect(el.textContent).toBe('', 'nothing displayed'); expect(spy.calls.any()).toBe(false, 'getQuote not yet called'); }); it('should still not show quote after component initialized', () => { - fixture.detectChanges(); // trigger data binding + fixture.detectChanges(); // getQuote service is async => still has not returned with quote - expect(getQuote()).toBe('...', 'no quote yet'); + expect(el.textContent).toBe('...', 'no quote yet'); expect(spy.calls.any()).toBe(true, 'getQuote called'); }); // #docregion async-test it('should show quote after getQuote promise (async)', async(() => { - fixture.detectChanges(); // trigger data binding + fixture.detectChanges(); fixture.whenStable().then(() => { // wait for async getQuote fixture.detectChanges(); // update view with quote - expect(getQuote()).toBe(testQuote); + expect(el.textContent).toBe(testQuote); }); })); // #enddocregion async-test // #docregion fake-async-test it('should show quote after getQuote promise (fakeAsync)', fakeAsync(() => { - fixture.detectChanges(); // trigger data binding + fixture.detectChanges(); tick(); // wait for async getQuote fixture.detectChanges(); // update view with quote - expect(getQuote()).toBe(testQuote); + expect(el.textContent).toBe(testQuote); })); // #enddocregion fake-async-test // #enddocregion tests // #docregion done-test it('should show quote after getQuote promise (done)', done => { - fixture.detectChanges(); // trigger data binding + fixture.detectChanges(); // get the spy promise and wait for it to resolve spy.calls.mostRecent().returnValue.then(() => { fixture.detectChanges(); // update view with quote - expect(getQuote()).toBe(testQuote); + expect(el.textContent).toBe(testQuote); done(); }); }); diff --git a/public/docs/_examples/testing/ts/app/welcome.component.spec.ts b/public/docs/_examples/testing/ts/app/welcome.component.spec.ts index f99687148f..e506dda396 100644 --- a/public/docs/_examples/testing/ts/app/welcome.component.spec.ts +++ b/public/docs/_examples/testing/ts/app/welcome.component.spec.ts @@ -1,7 +1,7 @@ // #docplaster -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { DebugElement } from '@angular/core'; +import { ComponentFixture, inject, TestBed } from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; +import { DebugElement } from '@angular/core'; import { UserService } from './model'; import { WelcomeComponent } from './welcome.component'; @@ -10,8 +10,10 @@ describe('WelcomeComponent', () => { let comp: WelcomeComponent; let fixture: ComponentFixture; - let userService: UserService; // the actually injected service - let welcomeEl: DebugElement; // the element with the welcome message + let componentUserService: UserService; // the actually injected service + let userService: UserService; // the TestBed injected service + let de: DebugElement; // the DebugElement with the welcome message + let el: HTMLElement; // the DOM element with the welcome message let userServiceStub: { isLoggedIn: boolean; @@ -32,7 +34,8 @@ describe('WelcomeComponent', () => { TestBed.configureTestingModule({ declarations: [ WelcomeComponent ], // #enddocregion setup - // providers: [ UserService ] // a real service would be a problem! + // providers: [ UserService ] // NO! Don't provide the real service! + // Provide a test-double instead // #docregion setup providers: [ {provide: UserService, useValue: userServiceStub } ] }); @@ -42,51 +45,64 @@ describe('WelcomeComponent', () => { comp = fixture.componentInstance; // #enddocregion setup - // #docregion inject-from-testbed - // UserService provided to the TestBed - userService = TestBed.get(UserService); - // #enddocregion inject-from-testbed - // #docregion setup - // #docregion injected-service + // #docregion injected-service // UserService actually injected into the component userService = fixture.debugElement.injector.get(UserService); // #enddocregion injected-service + componentUserService = userService; + // #docregion setup + // #docregion inject-from-testbed + // UserService from the root injector + userService = TestBed.get(UserService); + // #enddocregion inject-from-testbed // get the "welcome" element by CSS selector (e.g., by class name) - welcomeEl = fixture.debugElement.query(By.css('.welcome')); + de = fixture.debugElement.query(By.css('.welcome')); + el = de.nativeElement; }); // #enddocregion setup // #docregion tests it('should welcome the user', () => { - fixture.detectChanges(); // trigger data binding - - let content = welcomeEl.nativeElement.textContent; + fixture.detectChanges(); + const content = el.textContent; expect(content).toContain('Welcome', '"Welcome ..."'); expect(content).toContain('Test User', 'expected name'); }); it('should welcome "Bubba"', () => { userService.user.name = 'Bubba'; // welcome message hasn't been shown yet - - fixture.detectChanges(); // trigger data binding - - let content = welcomeEl.nativeElement.textContent; - expect(content).toContain('Bubba'); + fixture.detectChanges(); + expect(el.textContent).toContain('Bubba'); }); it('should request login if not logged in', () => { userService.isLoggedIn = false; // welcome message hasn't been shown yet - - fixture.detectChanges(); // trigger data binding - - let content = welcomeEl.nativeElement.textContent; + fixture.detectChanges(); + const content = el.textContent; expect(content).not.toContain('Welcome', 'not welcomed'); expect(content).toMatch(/log in/i, '"log in"'); }); // #enddocregion tests - it('orig stub and injected UserService are not the same object', () => { - expect(userServiceStub === userService).toBe(false); + // #docregion inject-it + it('should inject the component\'s UserService instance', + inject([UserService], (service: UserService) => { + expect(service).toBe(componentUserService); + })); + // #enddocregion inject-it + + it('TestBed and Component UserService should be the same', () => { + expect(userService === componentUserService).toBe(true); }); + + // #docregion stub-not-injected + it('stub object and injected UserService should not be the same', () => { + expect(userServiceStub === userService).toBe(false); + + // Changing the stub object has no effect on the injected service + userServiceStub.isLoggedIn = false; + expect(userService.isLoggedIn).toBe(true); + }); + // #enddocregion stub-not-injected }); diff --git a/public/docs/dart/latest/cookbook/_data.json b/public/docs/dart/latest/cookbook/_data.json index 931857b846..f0c0dad0d4 100644 --- a/public/docs/dart/latest/cookbook/_data.json +++ b/public/docs/dart/latest/cookbook/_data.json @@ -60,7 +60,7 @@ "ts-to-js": { "title": "TypeScript to JavaScript", - "intro": "Convert Angular 2 TypeScript examples into ES5 JavaScript", + "intro": "Convert Angular TypeScript examples into ES5 JavaScript", "hide": true }, diff --git a/public/docs/dart/latest/guide/_data.json b/public/docs/dart/latest/guide/_data.json index f13c3c42c8..68717b46ce 100644 --- a/public/docs/dart/latest/guide/_data.json +++ b/public/docs/dart/latest/guide/_data.json @@ -10,7 +10,7 @@ "architecture": { "title": "Architecture Overview", "navTitle": "Architecture", - "intro": "The basic building blocks of Angular 2 applications", + "intro": "The basic building blocks of Angular applications", "nextable": true, "basics": true }, @@ -59,7 +59,7 @@ "style-guide": { "title": "Style Guide", - "intro": "Write Angular 2 with style.", + "intro": "Write Angular with style.", "basics": true }, @@ -92,7 +92,7 @@ "glossary": { "title": "Glossary", - "intro": "Brief definitions of the most important words in the Angular 2 vocabulary", + "intro": "Brief definitions of the most important words in the Angular vocabulary", "basics": true }, @@ -125,7 +125,7 @@ "router": { "title": "Routing & Navigation", - "intro": "Discover the basics of screen navigation with the Angular 2 Component Router." + "intro": "Discover the basics of screen navigation with the Angular Component Router." }, "security": { @@ -140,13 +140,13 @@ "testing": { "title": "Testing", - "intro": "Techniques and practices for testing an Angular 2 app", + "intro": "Techniques and practices for testing an Angular app", "hide": true }, "typescript-configuration": { "title": "TypeScript Configuration", - "intro": "TypeScript configuration for Angular 2 developers", + "intro": "TypeScript configuration for Angular developers", "hide": true }, @@ -158,7 +158,7 @@ "webpack": { "title": "Webpack: an introduction", - "intro": "Create your Angular 2 applications with a Webpack based tooling", + "intro": "Create your Angular applications with a Webpack based tooling", "hide": true } } diff --git a/public/docs/js/latest/cookbook/_data.json b/public/docs/js/latest/cookbook/_data.json index 7443923155..a5e0ca3011 100644 --- a/public/docs/js/latest/cookbook/_data.json +++ b/public/docs/js/latest/cookbook/_data.json @@ -55,7 +55,7 @@ "ts-to-js": { "title": "TypeScript to JavaScript", - "intro": "Convert Angular 2 TypeScript examples into ES5 JavaScript" + "intro": "Convert Angular TypeScript examples into ES5 JavaScript" }, "visual-studio-2015": { diff --git a/public/docs/js/latest/guide/_data.json b/public/docs/js/latest/guide/_data.json index 724711f666..72977625c0 100644 --- a/public/docs/js/latest/guide/_data.json +++ b/public/docs/js/latest/guide/_data.json @@ -10,7 +10,7 @@ "architecture": { "title": "Architecture Overview", "navTitle": "Architecture", - "intro": "The basic building blocks of Angular 2 applications", + "intro": "The basic building blocks of Angular applications", "nextable": true, "basics": true }, @@ -59,7 +59,7 @@ "style-guide": { "title": "Style Guide", - "intro": "Write Angular 2 with style.", + "intro": "Write Angular with style.", "basics": true }, @@ -86,7 +86,7 @@ "glossary": { "title": "Glossary", - "intro": "Brief definitions of the most important words in the Angular 2 vocabulary", + "intro": "Brief definitions of the most important words in the Angular vocabulary", "basics": true }, @@ -118,7 +118,7 @@ "router": { "title": "Routing & Navigation", - "intro": "Discover the basics of screen navigation with the Angular 2 router." + "intro": "Discover the basics of screen navigation with the Angular router." }, "security": { @@ -133,13 +133,13 @@ "testing": { "title": "Testing", - "intro": "Techniques and practices for testing an Angular 2 app", + "intro": "Techniques and practices for testing an Angular app", "hide": true }, "typescript-configuration": { "title": "TypeScript Configuration", - "intro": "TypeScript configuration for Angular 2 developers", + "intro": "TypeScript configuration for Angular developers", "hide": true }, @@ -150,7 +150,7 @@ "webpack": { "title": "Webpack: an introduction", - "intro": "Create your Angular 2 applications with a Webpack based tooling", + "intro": "Create your Angular applications with a Webpack based tooling", "hide": true } } diff --git a/public/docs/ts/latest/cookbook/_data.json b/public/docs/ts/latest/cookbook/_data.json index 828aece748..87e4619d56 100644 --- a/public/docs/ts/latest/cookbook/_data.json +++ b/public/docs/ts/latest/cookbook/_data.json @@ -65,7 +65,7 @@ "ts-to-js": { "title": "TypeScript to JavaScript", - "intro": "Convert Angular 2 TypeScript examples into ES5 JavaScript" + "intro": "Convert Angular TypeScript examples into ES5 JavaScript" }, "visual-studio-2015": { diff --git a/public/docs/ts/latest/guide/_data.json b/public/docs/ts/latest/guide/_data.json index 2bd99c1ca6..be61fbd4ce 100644 --- a/public/docs/ts/latest/guide/_data.json +++ b/public/docs/ts/latest/guide/_data.json @@ -10,7 +10,7 @@ "architecture": { "title": "Architecture Overview", "navTitle": "Architecture", - "intro": "The basic building blocks of Angular 2 applications", + "intro": "The basic building blocks of Angular applications", "nextable": true, "basics": true }, @@ -59,7 +59,7 @@ "style-guide": { "title": "Style Guide", - "intro": "Write Angular 2 with style.", + "intro": "Write Angular with style.", "basics": true }, @@ -90,7 +90,7 @@ "glossary": { "title": "Glossary", - "intro": "Brief definitions of the most important words in the Angular 2 vocabulary", + "intro": "Brief definitions of the most important words in the Angular vocabulary", "basics": true }, @@ -122,7 +122,7 @@ "router": { "title": "Routing & Navigation", - "intro": "Discover the basics of screen navigation with the Angular 2 Router." + "intro": "Discover the basics of screen navigation with the Angular Router." }, "security": { @@ -137,12 +137,12 @@ "testing": { "title": "Testing", - "intro": "Techniques and practices for testing an Angular 2 app" + "intro": "Techniques and practices for testing an Angular app" }, "typescript-configuration": { "title": "TypeScript Configuration", - "intro": "TypeScript configuration for Angular 2 developers" + "intro": "TypeScript configuration for Angular developers" }, "upgrade": { @@ -152,6 +152,6 @@ "webpack": { "title": "Webpack: an introduction", - "intro": "Create your Angular 2 applications with a Webpack based tooling" + "intro": "Create your Angular applications with a Webpack based tooling" } } diff --git a/public/docs/ts/latest/guide/testing.jade b/public/docs/ts/latest/guide/testing.jade index 7889cb668b..abea24721d 100644 --- a/public/docs/ts/latest/guide/testing.jade +++ b/public/docs/ts/latest/guide/testing.jade @@ -9,7 +9,7 @@ block includes :marked This chapter offers tips and techniques for testing Angular applications. Along the way you will learn some general testing principles and techniques but the focus is on - Angular testing. + testing applications written with Angular #top :marked @@ -21,17 +21,20 @@ block includes - [npm packages](#npm-packages) 1. [The first karma test](#1st-karma-test)

- 1. [The Angular Testing Platform (ATP) ](#atp-intro) + 1. [Introduction to the Angular testing utilities](#atu-intro)

1. [The sample application and its tests](#sample-app)

1. [A simple component test](#simple-component-test) - [_configureTestingModule_](#configure-testing-module) - [_createComponent_](#create-component) + - [_ComponentFixture_, _DebugElement_, _query(By.css)_](#component-fixture) - [_detectChanges_](#detect-changes) - [_autoDetectChanges_](#auto-detect-changes) 1. [Test a component with a service dependency](#component-with-dependency) -

+ - [test doubles](#service-test-doubles) + - [get the injected service](#get-injected-service) + - [_TestBed.get_](#testbed-get) 1. [Test a component with an async service](#component-with-async-service) - [spies](#service-spy) - [_async_](#async) @@ -64,12 +67,12 @@ block includes

1. [Test an attribute directive](#attribute-directive)

- 1. [Isolated tests](#testing-without-atp "Testing without the Angular Testing Platform") + 1. [Isolated unit tests](#isolated-unit-tests "Unit testing without the Angular testing utilities") - [Services](#isolated-service-tests) - [Pipes](#isolated-pipe-tests) - [Components](#isolated-component-tests) - 1. [_Angular Testing Platform_ API](#atp-api) - - [Stand-alone functions](#atp-api): `async`, `fakeAsync`, etc. + 1. [Angular testing utility APIs](#atu-apis) + - [Stand-alone functions](#atu-apis): `async`, `fakeAsync`, etc. - [_TestBed_](#testbed-class-summary) - [_ComponentFixture_](#component-fixture-class-summary) - [_DebugElement_](#debug-element-details) @@ -102,9 +105,6 @@ a(href="#top").to-top Back to top When a part of the application seems hard to test, the root cause is often a design flaw, something to cure now rather than later when it becomes expensive to fix. - This chapter assumes that you know something about testing. Don't worry if you don't. - There are plenty of books and online resources to get up to speed. -