"Fossies" - the Fresh Open Source Software Archive

Member "angular-8.2.14/aio/content/examples/testing/src/app/about/about.component.spec.ts" (13 Nov 2019, 876 Bytes) of package /linux/www/angular-8.2.14.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 import { NO_ERRORS_SCHEMA }          from '@angular/core';
    2 import { ComponentFixture, TestBed } from '@angular/core/testing';
    3 
    4 import { AboutComponent }     from './about.component';
    5 import { HighlightDirective } from '../shared/highlight.directive';
    6 
    7 let fixture: ComponentFixture<AboutComponent>;
    8 
    9 describe('AboutComponent (highlightDirective)', () => {
   10   // #docregion tests
   11   beforeEach(() => {
   12     fixture = TestBed.configureTestingModule({
   13       declarations: [ AboutComponent, HighlightDirective],
   14       schemas:      [ NO_ERRORS_SCHEMA ]
   15     })
   16     .createComponent(AboutComponent);
   17     fixture.detectChanges(); // initial binding
   18   });
   19 
   20   it('should have skyblue <h2>', () => {
   21     const h2: HTMLElement = fixture.nativeElement.querySelector('h2');
   22     const bgColor = h2.style.backgroundColor;
   23     expect(bgColor).toBe('skyblue');
   24   });
   25   // #enddocregion tests
   26 });