import { shallowMount } from '@vue/test-utils';
import App from '@/App.vue';
import { createPinia } from 'pinia';
import { createApp } from 'vue';
import steeringTextModal from '@/iss-components/steering-text/steering-text.vue';

const mockCmsContent = {
    BodyText: 'MASteeringText'

};

const mockMixin = {
    methods: {
        getCmsContent: jest.fn((widgetName, cmsFieldName) => mockCmsContent[cmsFieldName])
    }
};

describe('steering-text.vue', () => {
    test('Should display steering text from CMS for state MA', async () => {
        // Act

        const wrapper = shallowMount(steeringTextModal, {
            mixins: [mockMixin],
            props: {
                cmsWidgetName: 'MASteeringTextWidget'
            },
            attachTo: document.body
        });
        expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent.BodyText));
    });
});

const vueApp = createApp(App);
const pinia = createPinia();
vueApp.use(pinia);
