import React from 'react';
import { mount } from 'enzyme';
import { STORE } from '../../../constants';
import ArtistProfileEmpty from '../artistPopoverEmpty';

describe('<ArtistProfileEmpty>', () => {
    const renderComponent = (store?: number) => mount(<ArtistProfileEmpty store={store} />);

    describe('when it renders', () => {
        it('displays correct layout', () => {
            expect(renderComponent(STORE.APPLE_MUSIC)).toMatchSnapshot();
        });
        it('renders correct Spotify store icon', () => {
            const testComponent = renderComponent(STORE.SPOTIFY);
            expect(testComponent.find('.SpotifyStoreIcon').exists()).toBeTruthy();
        });
        it('does not render store icon if it is not set', () => {
            const testComponent = renderComponent();
            expect(testComponent.find('.Icon').exists()).toBeFalsy();
        });
    });
});
