This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7db88e8
commit 65824da
Showing
55 changed files
with
1,887 additions
and
5 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
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,2 @@ | ||
<toast-visual> | ||
</toast-visual> |
5 changes: 5 additions & 0 deletions
5
skyux-spa-visual-tests/src/app/toast/toast-demo.component.html
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,5 @@ | ||
<strong | ||
class="sky-custom-toast" | ||
> | ||
Toast component | ||
</strong> |
19 changes: 19 additions & 0 deletions
19
skyux-spa-visual-tests/src/app/toast/toast-demo.component.ts
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,19 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component | ||
} from '@angular/core'; | ||
|
||
import { | ||
SkyToastInstance | ||
} from '@blackbaud/skyux/dist/core'; | ||
|
||
@Component({ | ||
selector: 'sky-test-cmp-toast', | ||
templateUrl: './toast-demo.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class ToastDemoComponent { | ||
constructor( | ||
public message: SkyToastInstance | ||
) { } | ||
} |
18 changes: 18 additions & 0 deletions
18
skyux-spa-visual-tests/src/app/toast/toast-visual.component.html
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,18 @@ | ||
<div | ||
id="screenshot-toast" | ||
> | ||
<button | ||
class="sky-btn sky-btn-primary" | ||
type="button" | ||
(click)="openToasts()" | ||
> | ||
Open toasts | ||
</button> | ||
<button | ||
class="sky-btn sky-btn-secondary" | ||
type="button" | ||
(click)="openComponents()" | ||
> | ||
Open custom toasts | ||
</button> | ||
</div> |
43 changes: 43 additions & 0 deletions
43
skyux-spa-visual-tests/src/app/toast/toast-visual.component.ts
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,43 @@ | ||
import { | ||
Component, | ||
ChangeDetectionStrategy, | ||
OnDestroy | ||
} from '@angular/core'; | ||
|
||
import { | ||
SkyToastService, | ||
SkyToastType | ||
} from '@blackbaud/skyux/dist/core'; | ||
|
||
import { | ||
ToastDemoComponent | ||
} from './toast-demo.component'; | ||
|
||
@Component({ | ||
selector: 'toast-visual', | ||
templateUrl: './toast-visual.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class ToastVisualComponent implements OnDestroy { | ||
constructor( | ||
private toastService: SkyToastService | ||
) { } | ||
|
||
public ngOnDestroy(): void { | ||
this.toastService.closeAll(); | ||
} | ||
|
||
public openToasts(): void { | ||
this.toastService.openMessage('Toast message', { type: SkyToastType.Info }); | ||
this.toastService.openMessage('Toast message', { type: SkyToastType.Success }); | ||
this.toastService.openMessage('Toast message', { type: SkyToastType.Warning }); | ||
this.toastService.openMessage('Toast message', { type: SkyToastType.Danger }); | ||
} | ||
|
||
public openComponents(): void { | ||
this.toastService.openComponent(ToastDemoComponent, { type: SkyToastType.Info }); | ||
this.toastService.openComponent(ToastDemoComponent, { type: SkyToastType.Success }); | ||
this.toastService.openComponent(ToastDemoComponent, { type: SkyToastType.Warning }); | ||
this.toastService.openComponent(ToastDemoComponent, { type: SkyToastType.Danger }); | ||
} | ||
} |
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,58 @@ | ||
import { | ||
SkyVisualTest | ||
} from '../../../config/utils/visual-test-commands'; | ||
|
||
import { | ||
by, | ||
element | ||
} from 'protractor'; | ||
|
||
describe('Toast', () => { | ||
it('should match previous toast screenshot', () => { | ||
return SkyVisualTest.setupTest('toast') | ||
.then(() => { | ||
element(by.css('.sky-btn-primary')).click(); | ||
SkyVisualTest.moveCursorOffScreen(); | ||
return SkyVisualTest.compareScreenshot({ | ||
screenshotName: 'toast', | ||
selector: '.sky-toaster' | ||
}); | ||
}); | ||
}); | ||
|
||
it('should match previous templated toast screenshot', () => { | ||
return SkyVisualTest.setupTest('toast') | ||
.then(() => { | ||
element(by.css('.sky-btn-secondary')).click(); | ||
SkyVisualTest.moveCursorOffScreen(); | ||
return SkyVisualTest.compareScreenshot({ | ||
screenshotName: 'toast-component', | ||
selector: '.sky-toaster' | ||
}); | ||
}); | ||
}); | ||
|
||
it('should match previous toast screenshot on tiny screens', () => { | ||
return SkyVisualTest.setupTest('toast', 480) | ||
.then(() => { | ||
element(by.css('.sky-btn-primary')).click(); | ||
SkyVisualTest.moveCursorOffScreen(); | ||
return SkyVisualTest.compareScreenshot({ | ||
screenshotName: 'toast-xs', | ||
selector: '.sky-toaster' | ||
}); | ||
}); | ||
}); | ||
|
||
it('should match previous templated toast screenshot on tiny screens', () => { | ||
return SkyVisualTest.setupTest('toast', 480) | ||
.then(() => { | ||
element(by.css('.sky-btn-secondary')).click(); | ||
SkyVisualTest.moveCursorOffScreen(); | ||
return SkyVisualTest.compareScreenshot({ | ||
screenshotName: 'toast-component-xs', | ||
selector: '.sky-toaster' | ||
}); | ||
}); | ||
}); | ||
}); |
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
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,2 @@ | ||
export * from './toast-custom-demo.component'; | ||
export * from './toast-demo.component'; |
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,5 @@ | ||
export class SkyToastCustomDemoContext { | ||
constructor( | ||
public message: string | ||
) { } | ||
} |
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,13 @@ | ||
<p> | ||
{{ context.message }} | ||
</p> | ||
<p> | ||
Some link: <a href="http://example.com">example.com</a> | ||
</p> | ||
<button | ||
class="sky-btn sky-btn-default" | ||
type="button" | ||
(click)="close()" | ||
> | ||
Close | ||
</button> |
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,28 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component | ||
} from '@angular/core'; | ||
|
||
import { | ||
SkyToastInstance | ||
} from '../../core'; | ||
|
||
import { | ||
SkyToastCustomDemoContext | ||
} from './toast-custom-demo-context'; | ||
|
||
@Component({ | ||
selector: 'sky-toast-custom-demo', | ||
templateUrl: './toast-custom-demo.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class SkyToastCustomDemoComponent { | ||
constructor( | ||
public context: SkyToastCustomDemoContext, | ||
private instance: SkyToastInstance | ||
) { } | ||
|
||
public close(): void { | ||
this.instance.close(); | ||
} | ||
} |
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,44 @@ | ||
<div class="sky-toast-demo"> | ||
<fieldset> | ||
<label class="sky-control-label"> | ||
Select toast type: | ||
</label> | ||
<ul class="sky-list-unstyled"> | ||
<li *ngFor="let type of types"> | ||
<sky-radio | ||
name="radiogroup" | ||
[value]="type.value" | ||
[(ngModel)]="selectedType" | ||
> | ||
<sky-radio-label> | ||
{{ type.label }} | ||
</sky-radio-label> | ||
</sky-radio> | ||
</li> | ||
</ul> | ||
</fieldset> | ||
|
||
<button | ||
class="sky-btn sky-btn-primary" | ||
type="button" | ||
(click)="openMessage()" | ||
> | ||
Open toast | ||
</button> | ||
|
||
<button | ||
class="sky-btn sky-btn-primary" | ||
type="button" | ||
(click)="openComponent()" | ||
> | ||
Open toast with custom component | ||
</button> | ||
|
||
<button | ||
class="sky-btn sky-btn-default" | ||
type="button" | ||
(click)="closeAll()" | ||
> | ||
Close all | ||
</button> | ||
</div> |
Oops, something went wrong.