diff --git a/aio/src/app/app.component.html b/aio/src/app/app.component.html index 1d05bb2f77..4df413b49d 100644 --- a/aio/src/app/app.component.html +++ b/aio/src/app/app.component.html @@ -22,9 +22,7 @@
- +
diff --git a/aio/src/app/app.component.spec.ts b/aio/src/app/app.component.spec.ts index bb8df3d63e..836b180285 100644 --- a/aio/src/app/app.component.spec.ts +++ b/aio/src/app/app.component.spec.ts @@ -24,6 +24,7 @@ import { ScrollService } from 'app/shared/scroll.service'; import { SearchBoxComponent } from 'app/search/search-box/search-box.component'; import { SearchResultsComponent } from 'app/search/search-results/search-results.component'; import { SearchService } from 'app/search/search.service'; +import { SelectComponent, Option } from 'app/shared/select/select.component'; import { SwUpdateNotificationsService } from 'app/sw-updates/sw-update-notifications.service'; import { TocComponent } from 'app/embedded/toc/toc.component'; import { MdSidenav } from '@angular/material'; @@ -221,26 +222,28 @@ describe('AppComponent', () => { }); describe('SideNav version selector', () => { + let selectElement: DebugElement; + let selectComponent: SelectComponent; beforeEach(() => { component.onResize(sideBySideBreakPoint + 1); // side-by-side + selectElement = fixture.debugElement.query(By.directive(SelectComponent)); + selectComponent = selectElement.componentInstance; }); it('should pick first (current) version by default', () => { - const versionSelector = sidenav.querySelector('select'); - expect(versionSelector.value).toEqual(component.versionInfo.raw); - expect(versionSelector.selectedIndex).toEqual(0); + expect(selectComponent.selected.title).toEqual(component.versionInfo.raw); }); // Older docs versions have an href it('should navigate when change to a version with an href', () => { - component.onDocVersionChange(1); + selectElement.triggerEventHandler('change', { option: component.docVersions[1] as Option, index: 1}); expect(locationService.go).toHaveBeenCalledWith(TestHttp.docVersions[0].url); }); // The current docs version should not have an href // This may change when we perfect our docs versioning approach it('should not navigate when change to a version without an href', () => { - component.onDocVersionChange(0); + selectElement.triggerEventHandler('change', { option: component.docVersions[0] as Option, index: 0}); expect(locationService.go).not.toHaveBeenCalled(); }); }); diff --git a/aio/src/app/app.module.ts b/aio/src/app/app.module.ts index 8840c6d9b4..73e0154342 100644 --- a/aio/src/app/app.module.ts +++ b/aio/src/app/app.module.ts @@ -45,6 +45,8 @@ import { SearchResultsComponent } from './search/search-results/search-results.c import { SearchBoxComponent } from './search/search-box/search-box.component'; import { TocService } from 'app/shared/toc.service'; +import { SharedModule } from 'app/shared/shared.module'; + // These are the hardcoded inline svg sources to be used by the `` component export const svgIconProviders = [ { @@ -80,7 +82,8 @@ export const svgIconProviders = [ MdSidenavModule, MdTabsModule, MdToolbarModule, - SwUpdatesModule + SwUpdatesModule, + SharedModule ], declarations: [ AppComponent, diff --git a/aio/src/app/embedded/api/api-list.component.html b/aio/src/app/embedded/api/api-list.component.html index b4d73e7cc2..fa0dc36761 100644 --- a/aio/src/app/embedded/api/api-list.component.html +++ b/aio/src/app/embedded/api/api-list.component.html @@ -1,26 +1,17 @@
-
- -
    -
  • - {{t.title}} -
  • -
-
+ + -
- -
    -
  • - {{s.title}} -
  • -
-
+ +