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

describe("loader.vue", () => {
    test("if it rendered the HTML element with class", () => {
        // Arrange/Act
        const wrapper = shallowMount(loader, {
            props: {},
        });

        // Assert
        expect(wrapper.find("div").exists()).toBeTruthy();
        expect(wrapper.find(".loader").exists()).toBeTruthy();
    });

    test("if it correctly passed props", () => {
        // Arrange/Act
        const wrapper = shallowMount(loader, {
            props: {
                loaderColor: "blue",
                loaderPosition: "left",
            },
        });

        // Assert
        expect(wrapper.props()).toMatchObject({
            loaderColor: "blue",
            loaderPosition: "left",
        });
    });
});
