Skip to content

Commit

Permalink
docs(stark-ui): fix jsdoc in SvgViewBox directive. Cleanup code in un…
Browse files Browse the repository at this point in the history
…it tests.
  • Loading branch information
christophercr committed Jul 27, 2018
1 parent 0edae9b commit d82a11e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*tslint:disable:completed-docs*/
import { NO_ERRORS_SCHEMA } from "@angular/core";
import { async, ComponentFixture, TestBed } from "@angular/core/testing";
import { STARK_LOGGING_SERVICE, STARK_ROUTING_SERVICE } from "@nationalbankbelgium/stark-core";
import { MockStarkLoggingService, MockStarkRoutingService } from "@nationalbankbelgium/stark-core/testing";
Expand All @@ -22,8 +21,7 @@ describe("AppLogoComponent", () => {
providers: [
{ provide: STARK_LOGGING_SERVICE, useValue: new MockStarkLoggingService() },
{ provide: STARK_ROUTING_SERVICE, useClass: MockStarkRoutingService }
],
schemas: [NO_ERRORS_SCHEMA] // tells the Angular compiler to ignore unrecognized elements and attributes
]
})
/**
* Compile template and css
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* angular imports */
import { async, ComponentFixture, TestBed } from "@angular/core/testing";
import { Component, ViewChild, NO_ERRORS_SCHEMA, EventEmitter } from "@angular/core";
import { Component, ViewChild, EventEmitter } from "@angular/core";

/* jasmine imports */
import Spy = jasmine.Spy;
Expand Down Expand Up @@ -64,8 +64,7 @@ describe("SliderController", () => {
providers: [
{ provide: STARK_LOGGING_SERVICE, useValue: new MockStarkLoggingService() },
{ provide: STARK_ROUTING_SERVICE, useClass: MockStarkRoutingService }
],
schemas: [NO_ERRORS_SCHEMA] // tells the Angular compiler to ignore unrecognized elements and attributes
]
}).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*tslint:disable:completed-docs*/
import { ComponentFixture, fakeAsync, TestBed } from "@angular/core/testing";
import { StarkSvgViewBoxDirective } from "./svg-view-box.directive";
import { Component, DebugElement, NO_ERRORS_SCHEMA } from "@angular/core";
import { Component, DebugElement } from "@angular/core";
import { By } from "@angular/platform-browser";

describe("SvgViewBoxDirective", () => {
Expand Down Expand Up @@ -33,8 +33,7 @@ describe("SvgViewBoxDirective", () => {

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [StarkSvgViewBoxDirective, TestComponent],
schemas: [NO_ERRORS_SCHEMA]
declarations: [StarkSvgViewBoxDirective, TestComponent]
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { AfterViewChecked, Directive, ElementRef, Input, Renderer2 } from "@angu
*/
const directiveName: string = "[starkSvgViewBox]";

@Directive({
selector: directiveName
})
/**
* Directive to add the 'viewBox' attribute to an SVG element.
* Specially useful to fix the issue with the Angular Material's MatIcon directive which prevents the icons from
* being re-sized via CSS due to the 'viewBox' property not being added to the SVG element.
* @link https://github.com/angular/material2/issues/4422
* @link https://github.com/angular/material2/issues/5488
*/
@Directive({
selector: directiveName
})
export class StarkSvgViewBoxDirective implements AfterViewChecked {
/**
* Width and height to be set to the 'viewBox' attribute of the SVG element.
Expand Down

0 comments on commit d82a11e

Please sign in to comment.