// The Lucia project.
// Copyright 2026-2026 DSP, inc.  All rights reserved.
// Authors:
//   imacat.yang@dsp.im (imacat), 2026/03/05

import { describe, it, expect } from "vitest";
import { mount } from "@vue/test-utils";
import ResultArrow from "@/components/Discover/Conformance/ConformanceSidebar/ResultArrow.vue";

describe("ResultArrow", () => {
  it("renders list items from data prop", () => {
    const wrapper = mount(ResultArrow, {
      props: {
        data: ["Activity A", "Activity B", "Activity C"],
        select: null,
      },
    });
    const items = wrapper.findAll("li");
    expect(items.length).toBe(3);
    expect(items[0].text()).toContain("Activity A");
    expect(items[1].text()).toContain("Activity B");
    expect(items[2].text()).toContain("Activity C");
  });

  it("renders empty list when data is null", () => {
    const wrapper = mount(ResultArrow, {
      props: { data: null, select: null },
    });
    const items = wrapper.findAll("li");
    expect(items.length).toBe(0);
  });

  it("renders arrow_circle_down icon for each item", () => {
    const wrapper = mount(ResultArrow, {
      props: {
        data: ["Task 1"],
        select: null,
      },
    });
    expect(wrapper.find("span.material-symbols-outlined").text()).toContain(
      "arrow_circle_down",
    );
  });
});
