fix:通过E2E测试

This commit is contained in:
2026-03-10 00:52:59 +08:00
parent cef68a95d9
commit d206c79c24
8 changed files with 43 additions and 33 deletions

View File

@@ -368,8 +368,10 @@ const closeScreenPreview = () => {
};
// Home data
const homeLinks = ref<any[]>([]);
const homeLists = ref<Array<{ title: string; apps: any[] }>>([]);
const homeLinks = ref<Record<string, unknown>[]>([]);
const homeLists = ref<
Array<{ title: string; apps: Record<string, unknown>[] }>
>([]);
const homeLoading = ref(false);
const homeError = ref("");
@@ -405,7 +407,7 @@ const loadHome = async () => {
const appsJson = await r.json();
const rawApps = appsJson || [];
const apps = await Promise.all(
rawApps.map(async (a: any) => {
rawApps.map(async (a: Record<string, unknown>) => {
const baseApp = {
name: a.Name || a.name || a.Pkgname || a.PkgName || "",
pkgname: a.Pkgname || a.pkgname || "",

View File

@@ -1,9 +1,5 @@
import { describe, it, expect, beforeEach } from "vitest";
import {
downloads,
addDownload,
removeDownloadItem,
} from "@/global/downloadStatus";
import { downloads, removeDownloadItem } from "@/global/downloadStatus";
import type { DownloadItem } from "@/global/typedefinition";
describe("downloadStatus", () => {
@@ -31,7 +27,7 @@ describe("downloadStatus", () => {
retry: false,
};
addDownload(mockDownload);
downloads.value.push(mockDownload);
expect(downloads.value).toHaveLength(1);
expect(downloads.value[0].pkgname).toBe("test-app");

View File

@@ -51,15 +51,15 @@
import AppCard from "./AppCard.vue";
import { APM_STORE_BASE_URL } from "../global/storeConfig";
const props = defineProps<{
links: Array<any>;
lists: Array<{ title: string; apps: any[] }>;
defineProps<{
links: Array<Record<string, unknown>>;
lists: Array<{ title: string; apps: Record<string, unknown>[] }>;
loading: boolean;
error: string;
}>();
const emit = defineEmits<{
(e: "open-detail", app: any): void;
defineEmits<{
(e: "open-detail", app: Record<string, unknown>): void;
}>();
const computedImgUrl = (imgUrl: string) => {
@@ -68,7 +68,7 @@ const computedImgUrl = (imgUrl: string) => {
return `${APM_STORE_BASE_URL}/${window.apm_store.arch}${imgUrl}`;
};
const onLinkClick = (link: any) => {
const onLinkClick = (link: Record<string, unknown>) => {
if (link.type === "_blank") {
window.open(link.url, "_blank");
} else {

View File

@@ -41,10 +41,6 @@ const handleUpdate = () => {
emit("update");
};
const handleList = () => {
emit("list");
};
const handleSettings = () => {
emit("open-install-settings");
};