import { mount } from '@vue/test-utils';
import siteFooter from '@/iss-components/site-footer/site-footer.vue';

const mockMixin = {
    methods: {
        getCmsContent: jest.fn(),
        getPageNameByQueryString: jest.fn(() => 'welcome-page'),
        getFooterInfoBoxHeight: jest.fn(() => 80)
    }
};

describe('site-footer.vue', () => {
    // TODO: fix this so that it works correctly (toHaveBeenCalled()  <-- )
    it.skip('Should emit ForwardClicked on button click', async () => {
        // Act
        const wrapper = mount(siteFooter, {
            mixins: [mockMixin]
        });
        wrapper.vm.buttonClick();
        // Assert
        expect(wrapper.emitted().forwardClicked[0]).toHaveBeenCalled;
    });

    // TODO: fix this so that it works correctly (toHaveBeenCalled()  <-- 
    it.skip('Should emit BackClicked on link click', async () => {
        // Act
        const wrapper = mount(siteFooter, {
            mixins: [mockMixin]
        });
        wrapper.vm.linkClick();
        // Assert
        expect(wrapper.emitted().backClicked[0]).toHaveBeenCalled;
    });

    it('Should change button text when update button text is called', async () => {
        // Act
        const wrapper = mount(siteFooter, {
            mixins: [mockMixin]
        });
        wrapper.vm.updateButtonText('newText');

        // Assert
        expect(wrapper.componentVM.customButtontext).toBe('newText');
    });
});
