title: Ng2 - Unit test on Directive, detectChanges() not working
body: <p>My Directive:</p>
  
  <pre><code> @Directive({ selector: '[dynamicStep]' })
  export class DynamicStepDirective {
  
    @Input('dynamicStep') associatedMagnitude: number;
  
    constructor(private _renderer : Renderer2, public _el: ElementRef) {}
  
    ngOnInit() {
      this.setAttribute('1');
    }
  
    ngOnChanges() {
      this.setAttribute('a');
    }
    setAttribute(value: string) {
      this._renderer.setAttribute(this._el.nativeElement, 'step', value);
    }
  
  }
  </code></pre>
  
  <p>My unit Test:</p>
  
  <pre><code>    @Component({
    selector: 'dynamicStep',
    template: '&lt;input type="number" [dynamicStep]="inputMagnitude"&gt;'
  })
  class DynamicStepTestComponent {
    inputMagnitude: number = 1.00;
  }
  
  describe('DynamicStep', () =&gt; {
    let fixture = null,
      component: DynamicStepTestComponent = null,
      inputEl = null;
    beforeEach(async(() =&gt; {
      let config: any = commonConfig;
      config.declarations.push(DynamicStepTestComponent);
      TestBed.configureTestingModule(config).compileComponents();
      fixture = TestBed.createComponent(DynamicStepTestComponent);
      component = fixture.debugElement.componentInstance;
      inputEl = fixture.debugElement.query(By.css('input'));
    }));
  
    it('ngOnChanges() should call setAttribute() with \'0.1\' if associatedMagnitude is a number with 1 decimal place', async(() =&gt; {
      component.inputMagnitude = 5.3; //should trigger ngOnChanges()
      fixture.detectChanges();
      expect(inputEl.nativeElement.attributes.getNamedItem('step').value).toEqual('a');
    }));
  </code></pre>
  
  <p>It expects a but it gets 1. I think this is because ngOnChanges() hasn't fired, or the change hasn't propagated to the DOM yet, how can I fix this?</p>