64 lines
2.1 KiB
TypeScript
64 lines
2.1 KiB
TypeScript
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
import { HttpClientModule } from '@angular/common/http';
|
|
import { MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
|
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
import { MatDividerModule } from '@angular/material/divider';
|
|
import { MatButtonModule } from '@angular/material/button';
|
|
import { MatIconModule } from '@angular/material/icon';
|
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
import { MatInputModule } from '@angular/material/input';
|
|
import { MatTableModule } from '@angular/material/table';
|
|
import { MatMenuModule } from '@angular/material/menu';
|
|
import { FormsModule } from '@angular/forms';
|
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
import { ToastrService } from 'ngx-toastr';
|
|
import { CommandsGroupsComponent } from './commands-groups.component';
|
|
|
|
class MockToastrService {
|
|
success() {}
|
|
}
|
|
|
|
class MockMatDialogRef {
|
|
close() {}
|
|
}
|
|
|
|
describe('CommandsGroupsComponent', () => {
|
|
let component: CommandsGroupsComponent;
|
|
let fixture: ComponentFixture<CommandsGroupsComponent>;
|
|
let toastService: ToastrService;
|
|
|
|
beforeEach(async () => {
|
|
await TestBed.configureTestingModule({
|
|
declarations: [CommandsGroupsComponent],
|
|
imports: [
|
|
HttpClientModule,
|
|
MatDialogModule,
|
|
MatPaginatorModule,
|
|
MatDividerModule,
|
|
MatButtonModule,
|
|
MatIconModule,
|
|
MatFormFieldModule,
|
|
MatInputModule,
|
|
MatTableModule,
|
|
MatMenuModule,
|
|
FormsModule,
|
|
BrowserAnimationsModule,
|
|
],
|
|
providers: [
|
|
{ provide: ToastrService, useClass: MockToastrService },
|
|
{ provide: MatDialogRef, useClass: MockMatDialogRef }
|
|
]
|
|
}).compileComponents();
|
|
|
|
fixture = TestBed.createComponent(CommandsGroupsComponent);
|
|
component = fixture.componentInstance;
|
|
toastService = TestBed.inject(ToastrService);
|
|
fixture.detectChanges();
|
|
});
|
|
|
|
it('should create the component', () => {
|
|
expect(component).toBeTruthy();
|
|
});
|
|
|
|
});
|