"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/icon/icon.spec.ts" between
material2-7.3.5.tar.gz and material2-7.3.6.tar.gz

About: material2 offers Material Design components for Angular.

icon.spec.ts  (material2-7.3.5):icon.spec.ts  (material2-7.3.6)
skipping to change at line 56 skipping to change at line 56
imports: [HttpClientTestingModule, MatIconModule], imports: [HttpClientTestingModule, MatIconModule],
declarations: [ declarations: [
IconWithColor, IconWithColor,
IconWithLigature, IconWithLigature,
IconWithCustomFontCss, IconWithCustomFontCss,
IconFromSvgName, IconFromSvgName,
IconWithAriaHiddenFalse, IconWithAriaHiddenFalse,
IconWithBindingAndNgIf, IconWithBindingAndNgIf,
InlineIcon, InlineIcon,
SvgIconWithUserContent, SvgIconWithUserContent,
IconWithLigatureAndSvgBinding,
], ],
providers: [{ providers: [{
provide: MAT_ICON_LOCATION, provide: MAT_ICON_LOCATION,
useValue: {getPathname: () => fakePath} useValue: {getPathname: () => fakePath}
}] }]
}); });
TestBed.compileComponents(); TestBed.compileComponents();
})); }));
skipping to change at line 160 skipping to change at line 161
let fixture = TestBed.createComponent(IconWithLigature); let fixture = TestBed.createComponent(IconWithLigature);
const testComponent = fixture.componentInstance; const testComponent = fixture.componentInstance;
const matIconElement = fixture.debugElement.nativeElement.querySelector('m at-icon'); const matIconElement = fixture.debugElement.nativeElement.querySelector('m at-icon');
testComponent.iconName = 'home'; testComponent.iconName = 'home';
fixture.detectChanges(); fixture.detectChanges();
expect(sortedClassNames(matIconElement)) expect(sortedClassNames(matIconElement))
.toEqual(['mat-icon', 'mat-icon-no-color', 'myfont', 'notranslate']); .toEqual(['mat-icon', 'mat-icon-no-color', 'myfont', 'notranslate']);
}); });
it('should not clear the text of a ligature icon if the svgIcon is bound to
something falsy',
() => {
let fixture = TestBed.createComponent(IconWithLigatureAndSvgBinding);
const testComponent = fixture.componentInstance;
const matIconElement = fixture.debugElement.nativeElement.querySelector(
'mat-icon');
testComponent.iconName = undefined;
fixture.detectChanges();
expect(matIconElement.textContent.trim()).toBe('house');
});
}); });
describe('Icons from URLs', () => { describe('Icons from URLs', () => {
it('should register icon URLs by name', fakeAsync(() => { it('should register icon URLs by name', fakeAsync(() => {
iconRegistry.addSvgIcon('fluffy', trustUrl('cat.svg')); iconRegistry.addSvgIcon('fluffy', trustUrl('cat.svg'));
iconRegistry.addSvgIcon('fido', trustUrl('dog.svg')); iconRegistry.addSvgIcon('fido', trustUrl('dog.svg'));
let fixture = TestBed.createComponent(IconFromSvgName); let fixture = TestBed.createComponent(IconFromSvgName);
let svgElement: SVGElement; let svgElement: SVGElement;
const testComponent = fixture.componentInstance; const testComponent = fixture.componentInstance;
skipping to change at line 850 skipping to change at line 864
@Component({template: `<mat-icon [inline]="inline">{{iconName}}</mat-icon>`}) @Component({template: `<mat-icon [inline]="inline">{{iconName}}</mat-icon>`})
class InlineIcon { class InlineIcon {
inline = false; inline = false;
} }
@Component({template: `<mat-icon [svgIcon]="iconName"><div>Hello</div></mat-icon >`}) @Component({template: `<mat-icon [svgIcon]="iconName"><div>Hello</div></mat-icon >`})
class SvgIconWithUserContent { class SvgIconWithUserContent {
iconName: string | undefined = ''; iconName: string | undefined = '';
} }
@Component({template: '<mat-icon [svgIcon]="iconName">house</mat-icon>'})
class IconWithLigatureAndSvgBinding {
iconName: string | undefined;
}
 End of changes. 3 change blocks. 
0 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)