import { forwardRef } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

import { NewTransactionDialogComponent } from './new-transaction.component';

describe('NewTransactionDialogComponent', () => {
  let component: NewTransactionDialogComponent;
  let fixture: ComponentFixture<NewTransactionDialogComponent>;

  beforeEach(async () => {
    await TestBed.configureTestingModule({
      declarations: [ NewTransactionDialogComponent ],
      providers: [
        
        { provide: MatDialogRef, useValue: {} },
        { provide: MAT_DIALOG_DATA, useValue: {} },
        {
          provide: NG_VALUE_ACCESSOR,
          useExisting: forwardRef(() => NewTransactionDialogComponent),
          multi: true,
        }
      ],
        imports: [
          MatDialogModule,
          MatFormFieldModule, 
          ReactiveFormsModule, 
          MatInputModule, 
          NoopAnimationsModule,
          MatSelectModule,
          FormsModule,
          MatSlideToggleModule
        ]
    })
    .compileComponents();

    fixture = TestBed.createComponent(NewTransactionDialogComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});
