import * as React from 'react';
import {mount} from 'enzyme';
import {MessageModule, MessageModuleDefinitions} from '../MessageModule';
import {MessageProvider} from '../MessageProvider';
import {MessageProviderImpl} from './MessageProviderImpl';
import {TestAdaptor} from '../../../adaptors/framework/_tests/TestAdaptor';

describe('MessageModuleTesting', () => {
    const testAdaptor: TestAdaptor = new TestAdaptor();
    const messageProvider: MessageProvider = new MessageProviderImpl();
    const defaultTestModuleProps : MessageModuleDefinitions.Props = new MessageModuleDefinitions.Props(
        testAdaptor, messageProvider);

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

});
