mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
@@ -1,25 +1,24 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'
|
||||
|
||||
import { ToastsComponent } from './toasts.component';
|
||||
import { ToastsComponent } from './toasts.component'
|
||||
|
||||
describe('ToastsComponent', () => {
|
||||
let component: ToastsComponent;
|
||||
let fixture: ComponentFixture<ToastsComponent>;
|
||||
let component: ToastsComponent
|
||||
let fixture: ComponentFixture<ToastsComponent>
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ToastsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
declarations: [ToastsComponent],
|
||||
}).compileComponents()
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ToastsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
fixture = TestBed.createComponent(ToastsComponent)
|
||||
component = fixture.componentInstance
|
||||
fixture.detectChanges()
|
||||
})
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
expect(component).toBeTruthy()
|
||||
})
|
||||
})
|
||||
|
@@ -1,15 +1,14 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { Toast, ToastService } from 'src/app/services/toast.service';
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core'
|
||||
import { Subscription } from 'rxjs'
|
||||
import { Toast, ToastService } from 'src/app/services/toast.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-toasts',
|
||||
templateUrl: './toasts.component.html',
|
||||
styleUrls: ['./toasts.component.scss']
|
||||
styleUrls: ['./toasts.component.scss'],
|
||||
})
|
||||
export class ToastsComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(private toastService: ToastService) { }
|
||||
constructor(private toastService: ToastService) {}
|
||||
|
||||
subscription: Subscription
|
||||
|
||||
@@ -20,7 +19,8 @@ export class ToastsComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.subscription = this.toastService.getToasts().subscribe(toasts => this.toasts = toasts)
|
||||
this.subscription = this.toastService
|
||||
.getToasts()
|
||||
.subscribe((toasts) => (this.toasts = toasts))
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user