title: Karma formGroup expects a FormGroup instance. Please pass one in
body: <p>I understand the root of the error, the component I'm testing requires a <code>FormGroup</code> to be passed into it's <code>@Input() form: FormGroup</code>. I just can't figure out how to pass one in when testing this component.</p>
  
  <p>There error occurs in my before each function when I call <code>fixture.detectChanges()</code> so the form must be passed in before that point</p>
  
  <p>my current code get's the error group is not defined:</p>
  
  <pre><code>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
  import {
      ReactiveFormsModule,
      FormsModule,
      Validators,
      FormBuilder
  } from '@angular/forms';
  import { StaticComponent } from '../../firewall/static/static.component';
  
  describe('StaticComponent', () =&gt; {
      let component: StaticComponent;
      let fixture: ComponentFixture&lt;StaticComponent&gt;;
  
      beforeEach(
          async(() =&gt; {
              TestBed.configureTestingModule({
                  declarations: [
                      StaticComponent
                  ],
                  imports: [
                      CommonModule,
                      ReactiveFormsModule,
                      FormsModule
                  ],
                  providers: [
                      NetworkService,
                      NetworkValidator,
                      HostNameValidator,
                      NotificationsService
                  ]
              }).compileComponents();
          })
      );
  
      beforeEach(() =&gt; {
          fixture = TestBed.createComponent(StaticComponent);
          component = fixture.componentInstance;
          component.ruleForm = FormBuilder.group({
              chain: ['chain', Validators.required],
              ip: [
                  '',
                  Validators.required,
                  this.networkValidator.validateNetwork('ip')
              ],
              action: ['action', Validators.required]
          });
          fixture.detectChanges();
      });
  
      fit('should be created', () =&gt; {
          expect(component).toBeTruthy();
      });
  });
  </code></pre>
  
  <p><strong>How do I pass in a pre-fab form to my @Input of the component during the test? I cant seem to provide FormBuilder correctly</strong></p>