Apply repository-wide ESLint auto-fix formatting pass

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
2026-03-08 12:11:57 +08:00
parent 7c48faaa3d
commit 847904c49b
172 changed files with 13629 additions and 9154 deletions

View File

@@ -3,14 +3,14 @@
// Authors:
// imacat.yang@dsp.im (imacat), 2026/03/05
import { describe, it, expect } from 'vitest';
import { mount } from '@vue/test-utils';
import ResultCheck from '@/components/Discover/Conformance/ConformanceSidebar/ResultCheck.vue';
import { describe, it, expect } from "vitest";
import { mount } from "@vue/test-utils";
import ResultCheck from "@/components/Discover/Conformance/ConformanceSidebar/ResultCheck.vue";
// Mock $emitter to prevent errors
const mockEmitter = { on: () => {}, emit: () => {} };
describe('ResultCheck', () => {
describe("ResultCheck", () => {
const mountResultCheck = (props = {}) => {
return mount(ResultCheck, {
props: {
@@ -26,41 +26,41 @@ describe('ResultCheck', () => {
});
};
it('renders list from select prop on creation', () => {
it("renders list from select prop on creation", () => {
const wrapper = mountResultCheck({
select: ['Activity X', 'Activity Y'],
select: ["Activity X", "Activity Y"],
});
const items = wrapper.findAll('li');
const items = wrapper.findAll("li");
expect(items.length).toBe(2);
expect(items[0].text()).toContain('Activity X');
expect(items[1].text()).toContain('Activity Y');
expect(items[0].text()).toContain("Activity X");
expect(items[1].text()).toContain("Activity Y");
});
it('renders empty when select is null', () => {
it("renders empty when select is null", () => {
const wrapper = mountResultCheck({ select: null });
const items = wrapper.findAll('li');
const items = wrapper.findAll("li");
expect(items.length).toBe(0);
});
it('renders check_circle icon for each item', () => {
const wrapper = mountResultCheck({ select: ['Task 1'] });
expect(wrapper.find('span.material-symbols-outlined').text()).toContain(
'check_circle',
it("renders check_circle icon for each item", () => {
const wrapper = mountResultCheck({ select: ["Task 1"] });
expect(wrapper.find("span.material-symbols-outlined").text()).toContain(
"check_circle",
);
});
it('updates list when data prop changes', async () => {
const wrapper = mountResultCheck({ select: ['Initial'] });
expect(wrapper.findAll('li').length).toBe(1);
it("updates list when data prop changes", async () => {
const wrapper = mountResultCheck({ select: ["Initial"] });
expect(wrapper.findAll("li").length).toBe(1);
await wrapper.setProps({ data: ['New A', 'New B'] });
expect(wrapper.findAll('li').length).toBe(2);
expect(wrapper.text()).toContain('New A');
await wrapper.setProps({ data: ["New A", "New B"] });
expect(wrapper.findAll("li").length).toBe(2);
expect(wrapper.text()).toContain("New A");
});
it('updates list when select prop changes', async () => {
const wrapper = mountResultCheck({ select: ['Old'] });
await wrapper.setProps({ select: ['Changed'] });
expect(wrapper.text()).toContain('Changed');
it("updates list when select prop changes", async () => {
const wrapper = mountResultCheck({ select: ["Old"] });
await wrapper.setProps({ select: ["Changed"] });
expect(wrapper.text()).toContain("Changed");
});
});