import * as React from 'react';
import {mount} from 'enzyme';
import {FlagModule, FlagModuleDefinitions} from '../FlagModule';
import {FlagProvider} from '../FlagProvider';
import {FlagProviderImpl} from './FlagProviderImpl';
import {TestAdaptor} from '../../../adaptors/framework/_tests/TestAdaptor';

describe('FlagModuleTesting', () => {
    const testAdaptor: TestAdaptor = new TestAdaptor();
    const flagProvider: FlagProvider = new FlagProviderImpl();
    const defaultTestModuleProps : FlagModuleDefinitions.Props = new FlagModuleDefinitions.Props(
        testAdaptor, flagProvider);

    it('Should allow modules to be registered if the name is OK.', () : void => {
        const registeredBeforeMount = testAdaptor.isRegistered(FlagModuleDefinitions.FLAG_MODULE_NAME);
        expect(registeredBeforeMount).toEqual(false);
        mount(<FlagModule {...defaultTestModuleProps} />);
    });

});
