/** * @license * Copyright Akveo. All Rights Reserved. * Licensed under the MIT License. See License.txt in the project root for license information. */ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NbAlertComponent, NbAlertModule, NbThemeModule } from '@nebular/theme'; describe('Component: NbAlert', () => { let alert: NbAlertComponent; let fixture: ComponentFixture; beforeEach(() => { TestBed.configureTestingModule({ imports: [ NbThemeModule.forRoot(), NbAlertModule ], }); fixture = TestBed.createComponent(NbAlertComponent); alert = fixture.componentInstance; }); it('should set class danger', () => { alert.status = 'danger'; fixture.detectChanges(); expect( fixture .debugElement.nativeElement.classList.contains('status-danger')) .toBeTruthy() }); it('should set outline class', () => { alert.outline = 'success'; fixture.detectChanges(); expect( fixture .debugElement.nativeElement.classList.contains('outline-success')) .toBeTruthy() }); it('should set shape class', () => { alert.accent = 'warning'; fixture.detectChanges(); expect( fixture .debugElement.nativeElement.classList.contains('accent-warning')) .toBeTruthy() }); it('should set size class', () => { alert.size = 'small'; fixture.detectChanges(); expect( fixture .debugElement.nativeElement.classList.contains('size-small')) .toBeTruthy() }); });