refactor: notification last longer
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
40% {
|
||||
opacity: 1;
|
||||
}
|
||||
80% {
|
||||
70% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
@@ -22,13 +22,13 @@
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.5);
|
||||
padding: 1rem 3rem;
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
right: 1rem;
|
||||
top: 1rem;
|
||||
z-index: 999;
|
||||
|
||||
&--fade-in-out {
|
||||
animation: fade-in-out 0.8s ease-in-out forwards;
|
||||
animation: fade-in-out ease-in-out 1s forwards;
|
||||
}
|
||||
|
||||
&--success {
|
||||
|
||||
@@ -15,13 +15,13 @@ describe('Notifier', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should set notification on notify and clean it after 800ms', fakeAsync(() => {
|
||||
it('should set notification on notify and clean it after 1100ms', fakeAsync(() => {
|
||||
TestBed.tick();
|
||||
const NOTIFICATION_MOCK = new Notification('MOCK NOTIFICATION');
|
||||
service.notify(NOTIFICATION_MOCK);
|
||||
expect(service.notification$()).toEqual(NOTIFICATION_MOCK);
|
||||
TestBed.tick();
|
||||
tick(1000);
|
||||
tick(1100);
|
||||
expect(service.notification$()).toEqual(null);
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ export class Notifier {
|
||||
if (this.notification$()) {
|
||||
setTimeout(() => {
|
||||
this.cleanup();
|
||||
}, 800);
|
||||
}, 1100);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user