2023-05-23 15:02:54 -07:00
|
|
|
import { ComponentFixture, TestBed } from '@angular/core/testing'
|
|
|
|
|
import { By } from '@angular/platform-browser'
|
2024-12-13 00:27:30 -08:00
|
|
|
import { NgbAlert, NgbAlertModule } from '@ng-bootstrap/ng-bootstrap'
|
2023-05-23 15:02:54 -07:00
|
|
|
import { PermissionsGuard } from 'src/app/guards/permissions.guard'
|
|
|
|
|
import { WidgetFrameComponent } from '../widget-frame/widget-frame.component'
|
|
|
|
|
import { WelcomeWidgetComponent } from './welcome-widget.component'
|
|
|
|
|
|
|
|
|
|
describe('WelcomeWidgetComponent', () => {
|
|
|
|
|
let component: WelcomeWidgetComponent
|
|
|
|
|
let fixture: ComponentFixture<WelcomeWidgetComponent>
|
|
|
|
|
|
|
|
|
|
beforeEach(async () => {
|
|
|
|
|
TestBed.configureTestingModule({
|
|
|
|
|
providers: [PermissionsGuard],
|
2025-01-01 22:26:53 -08:00
|
|
|
imports: [NgbAlertModule, WelcomeWidgetComponent, WidgetFrameComponent],
|
2023-05-23 15:02:54 -07:00
|
|
|
}).compileComponents()
|
|
|
|
|
|
|
|
|
|
fixture = TestBed.createComponent(WelcomeWidgetComponent)
|
|
|
|
|
component = fixture.componentInstance
|
|
|
|
|
|
|
|
|
|
fixture.detectChanges()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
it('should be dismissable', () => {
|
|
|
|
|
let dismissResult
|
|
|
|
|
component.dismiss.subscribe(() => (dismissResult = true))
|
|
|
|
|
fixture.debugElement
|
|
|
|
|
.query(By.directive(NgbAlert))
|
|
|
|
|
.triggerEventHandler('closed')
|
|
|
|
|
expect(dismissResult).toBeTruthy()
|
|
|
|
|
})
|
|
|
|
|
})
|