Error: StaticInjectorError(DynamicTestModule)[FormControlName -> ControlContainer]:

I have a dynamic input component that I built which works fine but is giving me hell trying to unit test. The problem seems to revolve around using:

this.form = <FormGroup>this.controlContainer.control;

Essentially it is using the formgroup of the parent it is placed in and I don't want to have to pass in the formgroup each time as there could be hundreds of these on any given page.

No matter what I try I get the above (in title) error.

Here is my test spec (it likely has unnecessary code as I've been trying a few different approaches without luck:

import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {DynamicInputsComponent} from './dynamic-inputs.component';
import {FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";

fdescribe('DynamicInputsComponent', () => {
    let component: DynamicInputsComponent;
    let fixture: ComponentFixture<DynamicInputsComponent>;
    const controls: any = {
        testControl: new FormControl({value: '', disabled: false}, []),
    let thisForm = new FormGroup(controls);
    const formBuilder: FormBuilder = new FormBuilder();

    beforeEach(async(() => {
            declarations: [DynamicInputsComponent],
            imports: [ReactiveFormsModule, FormsModule, NgbModule],
            providers: [
                {provide: FormBuilder, useValue: formBuilder}

    beforeEach(() => {
        fixture = TestBed.createComponent(DynamicInputsComponent);
        component = fixture.componentInstance;
        component.form ={
            chain: ['chain', Validators.required],
            ip: [
            action: ['action', Validators.required]

    it('should create', () => {

Here is my component:

import {Component, Input, OnInit} from '@angular/core';
import {ControlContainer, FormControl, FormGroup} from '@angular/forms';

    selector: 'app-dynamic-input',
    templateUrl: './dynamic-inputs.component.html',
    styleUrls: ['./dynamic-inputs.component.css']

export class DynamicInputsComponent implements OnInit {
    public form: FormGroup;
    @Input() fromData: FormControl;
    @Input() controlName: string; // formControlName for this element
    @Input() value: any; // Preset Value
    @Input() type: string = 'text'; // Preset Value
    @Input() id: string; // Add an id to the field, if no id provided controlName is used
    @Input() label: string = ''; // Label for element (all elements should have a label)
    @Input() editable: boolean = true; // Is the field currently editable or readonly
    @Input() required: boolean = false; // Is the field required
    @Input() locked: boolean = false; // if state = locked the lock icon shows up next to label
    @Input() labelColumnSize: string = 'col-lg-4'; // Column size for label
    @Input() inputColumnSize: string = 'col-lg-4'; // Column size for input
    @Input() maxlength: number; // Maximum number of characters
    @Input() pattern: string; // Regex pattern of allowed field content
    @Input() alt: string = 'Please input ' + this.label; // Alternative text for screen readers
    @Input() placeholder: string = ''; // Placeholder text shown before user input

    constructor(private controlContainer: ControlContainer) {}

    ngOnInit() {
        // Assign this.form to the FormGroup of it's parent
        this.form = <FormGroup>this.controlContainer.control;

        if(this.controlName) {
            if(this.form.get(this.controlName).value && Object.keys(this.form.get(this.controlName).value).length !== 0 ) {
                this.value = this.form.get(this.controlName).value;
            } else {
                    .subscribe(next => {
                        this.value = next;
        } else {
            this.controlName = '';