import { shallowMount, mount } from "@vue/test-utils";
import CustomerDetails from "./customer-details.vue";

const mockMixin = {
    methods: {
        getCmsContent() {
            return "Mocked CMS Content";
        },
    },
};

const mockStoreActions = {
    SAVE_CUSTOMER_DETAILS: "SAVE_CUSTOMER_DETAILS",
    SAVE_SERVICE_LOCATION_TECH_NOTES: "SAVE_SERVICE_LOCATION_TECH_NOTES",
    SAVE_PAYMENT_METHOD_CHOICE: "SAVE_PAYMENT_METHOD_CHOICE",
};

describe("CustomerDetails.vue", () => {
    let wrapper;

    beforeEach(() => {
        wrapper = shallowMount(CustomerDetails, {
            global: {
                mixins: [mockMixin],
                mocks: {
                    storeActions: mockStoreActions,
                },
            },
            data() {
                return {
                    firstName: "John",
                    lastName: "Doe",
                    emailAddress: "john.doe@example.com",
                    phoneNumber: "1234567890",
                    isSmsOptIn: true,
                    techNotes: "Initial Tech Notes",
                };
            },
        });
    });

    it("Should render the CustomerDetails component", () => {
        expect(wrapper.exists()).toBe(true);
    });
});
