11import {
2- it ,
3- describe ,
4- expect ,
5- beforeEach ,
6- beforeEachProviders ,
7- inject ,
8- TestComponentBuilder ,
2+ it ,
3+ describe ,
4+ expect ,
5+ beforeEach ,
6+ beforeEachProviders ,
7+ inject ,
8+ TestComponentBuilder
99} from 'angular2/testing' ;
10- import {
11- HTTP_PROVIDERS ,
12- XHRBackend } from 'angular2/http' ;
10+ import { HTTP_PROVIDERS , XHRBackend } from 'angular2/http' ;
1311import { MockBackend } from 'angular2/http/testing' ;
14- import {
15- provide ,
16- Component } from 'angular2/core' ;
17-
12+ import { provide , Component } from 'angular2/core' ;
1813import { MdIcon } from './icon' ;
1914import { MdIconRegistry } from './icon-registry' ;
2015import { getFakeSvgHttpResponse } from './fake-svgs' ;
2116
17+
18+
2219/** Returns the CSS classes assigned to an element as a sorted array. */
2320const sortedClassNames = ( elem : Element ) => elem . className . split ( ' ' ) . sort ( ) ;
2421
@@ -74,7 +71,7 @@ export function main() {
7471
7572 describe ( 'Ligature icons' , ( ) => {
7673 it ( 'should add material-icons class by default' , ( done : ( ) => void ) => {
77- return builder . createAsync ( MdIconLigatureTestApp ) . then ( ( fixture ) => {
74+ return builder . createAsync ( MdIconLigatureTestApp ) . then ( fixture => {
7875 const testComponent = fixture . debugElement . componentInstance ;
7976 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
8077 testComponent . iconName = 'home' ;
@@ -86,7 +83,7 @@ export function main() {
8683
8784 it ( 'should use alternate icon font if set' , ( done : ( ) => void ) => {
8885 mdIconRegistry . setDefaultFontSetClass ( 'myfont' ) ;
89- return builder . createAsync ( MdIconLigatureTestApp ) . then ( ( fixture ) => {
86+ return builder . createAsync ( MdIconLigatureTestApp ) . then ( fixture => {
9087 const testComponent = fixture . debugElement . componentInstance ;
9188 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
9289 testComponent . iconName = 'home' ;
@@ -99,7 +96,7 @@ export function main() {
9996
10097 describe ( 'Icons from URLs' , ( ) => {
10198 it ( 'should fetch SVG icon from URL and inline the content' , ( done : ( ) => void ) => {
102- return builder . createAsync ( MdIconFromSvgUrlTestApp ) . then ( ( fixture ) => {
99+ return builder . createAsync ( MdIconFromSvgUrlTestApp ) . then ( fixture => {
103100 const testComponent = fixture . debugElement . componentInstance ;
104101 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
105102 let svgElement : any ;
@@ -135,7 +132,7 @@ export function main() {
135132 it ( 'should register icon URLs by name' , ( done : ( ) => void ) => {
136133 mdIconRegistry . addSvgIcon ( 'fluffy' , 'cat.svg' ) ;
137134 mdIconRegistry . addSvgIcon ( 'fido' , 'dog.svg' ) ;
138- return builder . createAsync ( MdIconFromSvgNameTestApp ) . then ( ( fixture ) => {
135+ return builder . createAsync ( MdIconFromSvgNameTestApp ) . then ( fixture => {
139136 const testComponent = fixture . debugElement . componentInstance ;
140137 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
141138 let svgElement : SVGElement ;
@@ -168,7 +165,7 @@ export function main() {
168165
169166 it ( 'should extract icon from SVG icon set' , ( done : ( ) => void ) => {
170167 mdIconRegistry . addSvgIconSetInNamespace ( 'farm' , 'farm-set-1.svg' ) ;
171- return builder . createAsync ( MdIconFromSvgNameTestApp ) . then ( ( fixture ) => {
168+ return builder . createAsync ( MdIconFromSvgNameTestApp ) . then ( fixture => {
172169 const testComponent = fixture . debugElement . componentInstance ;
173170 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
174171 let svgElement : any ;
@@ -207,7 +204,7 @@ export function main() {
207204 mdIconRegistry . addSvgIconSetInNamespace ( 'farm' , 'farm-set-1.svg' ) ;
208205 mdIconRegistry . addSvgIconSetInNamespace ( 'farm' , 'farm-set-2.svg' ) ;
209206 mdIconRegistry . addSvgIconSetInNamespace ( 'arrows' , 'arrow-set.svg' ) ;
210- return builder . createAsync ( MdIconFromSvgNameTestApp ) . then ( ( fixture ) => {
207+ return builder . createAsync ( MdIconFromSvgNameTestApp ) . then ( fixture => {
211208 const testComponent = fixture . debugElement . componentInstance ;
212209 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
213210 let svgElement : any ;
@@ -250,7 +247,7 @@ export function main() {
250247
251248 it ( 'should not wrap <svg> elements in icon sets in another svg tag' , ( done : ( ) => void ) => {
252249 mdIconRegistry . addSvgIconSet ( 'arrow-set.svg' ) ;
253- return builder . createAsync ( MdIconFromSvgNameTestApp ) . then ( ( fixture ) => {
250+ return builder . createAsync ( MdIconFromSvgNameTestApp ) . then ( fixture => {
254251 const testComponent = fixture . debugElement . componentInstance ;
255252 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
256253 let svgElement : any ;
@@ -268,7 +265,7 @@ export function main() {
268265 } ) ;
269266
270267 it ( 'should return unmodified copies of icons from URLs' , ( done : ( ) => void ) => {
271- return builder . createAsync ( MdIconFromSvgUrlTestApp ) . then ( ( fixture ) => {
268+ return builder . createAsync ( MdIconFromSvgUrlTestApp ) . then ( fixture => {
272269 const testComponent = fixture . debugElement . componentInstance ;
273270 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
274271 let svgElement : any ;
@@ -299,7 +296,7 @@ export function main() {
299296
300297 it ( 'should return unmodified copies of icons from icon sets' , ( done : ( ) => void ) => {
301298 mdIconRegistry . addSvgIconSet ( 'arrow-set.svg' ) ;
302- return builder . createAsync ( MdIconFromSvgNameTestApp ) . then ( ( fixture ) => {
299+ return builder . createAsync ( MdIconFromSvgNameTestApp ) . then ( fixture => {
303300 const testComponent = fixture . debugElement . componentInstance ;
304301 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
305302 let svgElement : any ;
@@ -333,7 +330,7 @@ export function main() {
333330 it ( 'should apply CSS classes for custom font and icon' , ( done : ( ) => void ) => {
334331 mdIconRegistry . registerFontClassAlias ( 'f1' , 'font1' ) ;
335332 mdIconRegistry . registerFontClassAlias ( 'f2' ) ;
336- return builder . createAsync ( MdIconCustomFontCssTestApp ) . then ( ( fixture ) => {
333+ return builder . createAsync ( MdIconCustomFontCssTestApp ) . then ( fixture => {
337334 const testComponent = fixture . debugElement . componentInstance ;
338335 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
339336 testComponent . fontSet = 'f1' ;
@@ -361,10 +358,12 @@ export function main() {
361358
362359 describe ( 'aria label' , ( ) => {
363360 it ( 'should set aria label from text content if not specified' , ( done : ( ) => void ) => {
364- return builder . createAsync ( MdIconLigatureTestApp ) . then ( ( fixture ) => {
361+ return builder . createAsync ( MdIconLigatureTestApp ) . then ( fixture => {
362+
365363 const testComponent = fixture . debugElement . componentInstance ;
366364 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
367365 testComponent . iconName = 'home' ;
366+
368367 fixture . detectChanges ( ) ;
369368 expect ( mdIconElement . getAttribute ( 'aria-label' ) ) . toBe ( 'home' ) ;
370369
@@ -377,7 +376,7 @@ export function main() {
377376 } ) ;
378377
379378 it ( 'should use alt tag if aria label is not specified' , ( done : ( ) => void ) => {
380- return builder . createAsync ( MdIconLigatureWithAriaBindingTestApp ) . then ( ( fixture ) => {
379+ return builder . createAsync ( MdIconLigatureWithAriaBindingTestApp ) . then ( fixture => {
381380 const testComponent = fixture . debugElement . componentInstance ;
382381 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
383382 testComponent . iconName = 'home' ;
@@ -394,7 +393,7 @@ export function main() {
394393 } ) ;
395394
396395 it ( 'should use provided aria label rather than icon name' , ( done : ( ) => void ) => {
397- return builder . createAsync ( MdIconLigatureWithAriaBindingTestApp ) . then ( ( fixture ) => {
396+ return builder . createAsync ( MdIconLigatureWithAriaBindingTestApp ) . then ( fixture => {
398397 const testComponent = fixture . debugElement . componentInstance ;
399398 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
400399 testComponent . iconName = 'home' ;
@@ -406,7 +405,7 @@ export function main() {
406405 } ) ;
407406
408407 it ( 'should use provided aria label rather than font icon' , ( done : ( ) => void ) => {
409- return builder . createAsync ( MdIconCustomFontCssTestApp ) . then ( ( fixture ) => {
408+ return builder . createAsync ( MdIconCustomFontCssTestApp ) . then ( fixture => {
410409 const testComponent = fixture . debugElement . componentInstance ;
411410 const mdIconElement = fixture . debugElement . nativeElement . querySelector ( 'md-icon' ) ;
412411 testComponent . fontSet = 'f1' ;
0 commit comments