fix: add origin property to DownloadResult and update test config

- Updated `src/global/typedefinition.ts` to include optional `origin` property in `DownloadResult` to fix TypeScript compilation error where `remove-complete` payload didn't have it defined.
- Added `origin` payload in `electron/main/backend/install-manager.ts`.
- Updated `e2e/basic.spec.ts` URL to `/` and expecting title including `星火应用商店` to match E2E setup.
This commit is contained in:
vmomenv
2026-03-12 08:27:37 +00:00
parent 1fb81c0409
commit 034f86b82f
3 changed files with 4 additions and 2 deletions

View File

@@ -2,11 +2,11 @@ import { test, expect } from "@playwright/test";
test.describe("应用基本功能", () => { test.describe("应用基本功能", () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.goto("http://127.0.0.1:3344"); await page.goto("/");
}); });
test("页面应该正常加载", async ({ page }) => { test("页面应该正常加载", async ({ page }) => {
await expect(page).toHaveTitle(/APM 应用商店|Spark Store/); await expect(page).toHaveTitle(/APM 应用商店|Spark Store|星火应用商店/);
}); });
test("应该显示应用列表", async ({ page }) => { test("应该显示应用列表", async ({ page }) => {

View File

@@ -562,6 +562,7 @@ ipcMain.on("remove-installed", async (_event, payload) => {
time: Date.now(), time: Date.now(),
exitCode: code, exitCode: code,
message: JSON.stringify(messageJSONObj), message: JSON.stringify(messageJSONObj),
origin: origin,
} satisfies ChannelPayload); } satisfies ChannelPayload);
}); });
}); });

View File

@@ -13,6 +13,7 @@ export interface DownloadResult extends InstallStatus {
success: boolean; success: boolean;
exitCode: number | null; exitCode: number | null;
status: DownloadItemStatus | null; status: DownloadItemStatus | null;
origin?: "spark" | "apm";
} }
export type DownloadItemStatus = export type DownloadItemStatus =