-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(alert): add outline alerts (#590)
- Loading branch information
Showing
8 changed files
with
191 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* @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 } from './alert.component'; | ||
|
||
describe('Component: NbAlert', () => { | ||
|
||
let alert: NbAlertComponent; | ||
let fixture: ComponentFixture<NbAlertComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [NbAlertComponent], | ||
}); | ||
|
||
fixture = TestBed.createComponent(NbAlertComponent); | ||
alert = fixture.componentInstance; | ||
}); | ||
|
||
it('should set class danger', () => { | ||
alert.status = 'danger'; | ||
fixture.detectChanges(); | ||
expect( | ||
fixture | ||
.debugElement.nativeElement.classList.contains('danger-alert')) | ||
.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 = 'xxsmall'; | ||
fixture.detectChanges(); | ||
expect( | ||
fixture | ||
.debugElement.nativeElement.classList.contains('xxsmall-alert')) | ||
.toBeTruthy() | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<nb-card> | ||
<nb-card-body> | ||
<nb-alert outline="success">You have been successfully authenticated!</nb-alert> | ||
<nb-alert outline="danger">You have been successfully authenticated!</nb-alert> | ||
<nb-alert outline="primary">You have been successfully authenticated!</nb-alert> | ||
<nb-alert outline="info">You have been successfully authenticated!</nb-alert> | ||
<nb-alert outline="warning">You have been successfully authenticated!</nb-alert> | ||
<nb-alert outline="active">You have been successfully authenticated!</nb-alert> | ||
<nb-alert outline="disabled">You have been successfully authenticated!</nb-alert> | ||
</nb-card-body> | ||
</nb-card> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @license | ||
* Copyright Akveo. All Rights Reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*/ | ||
|
||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nb-alert-outline', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
templateUrl: './alert-outline.component.html', | ||
}) | ||
export class NbAlertOutlineComponent { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters