import mountWithState from '../../../../Utils/Test/mountWithState';
import LicenseNotice from './LicenseNotice';

describe('Shared/Containers/LicenseNotice', () => {
    test('does not display license notice if there is a valid license for the current screen', () => {
        const state = {
            configurationMode: {
                selectedMode: 'designer',
                licenses: ['creator', 'designer'],
            },
        };
        const { wrapper } = mountWithState(LicenseNotice, state);
        expect(wrapper.find('LicenseNotice').props().displayMissingLicenseNotice).toBe(false);
    });

    test('displays license notice if there is no valid license for the current screen', () => {
        const state = {
            configurationMode: {
                selectedMode: 'designer',
                licenses: ['creator'],
            },
        };
        const { wrapper } = mountWithState(LicenseNotice, state);
        expect(wrapper.find('LicenseNotice').props().displayMissingLicenseNotice).toBe(true);
    });

    test('displays license notice if there is no valid licenses', () => {
        const state = {
            configurationMode: {
                selectedMode: 'designer',
                licenses: [],
            },
        };
        const { wrapper } = mountWithState(LicenseNotice, state);
        expect(wrapper.find('LicenseNotice').props().displayMissingLicenseNotice).toBe(true);
    });
});
