import { shallowMount } from "@vue/test-utils";
import textLink from "./text-link";
import { nextTick } from "vue";

describe("text-link.vue", () => {
    it("Should return class navigation-link", async () => {
        // Act
        const wrapper = shallowMount(textLink, {
            propsData: {
                linkType: "navigation",
            },
        });

        // Assert
        const paragraph = wrapper.find("a");

        // Expect
        expect(paragraph.attributes("class")).toContain("navigation-link");
    });

    it("Should return class new-window-link", async () => {
        // Act
        const wrapper = shallowMount(textLink, {
            propsData: {
                linkType: "newWindowLink",
            },
        });

        // Assert
        const paragraph = wrapper.find("a");

        // Expect
        expect(paragraph.attributes("class")).toContain("new-window-link");
    });

    it("Should return class text-small", async () => {
        // Act
        const wrapper = shallowMount(textLink, {
            propsData: {
                linkType: "textSmall",
            },
        });

        // Assert
        const paragraph = wrapper.find("a");

        // Expect
        expect(paragraph.attributes("class")).toContain("small");
    });
});
