mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-06-22 14:13:49 +08:00
fix(detail): normalize review store arch
This commit is contained in:
@@ -35,6 +35,15 @@ describe("appIdentity", () => {
|
|||||||
expect(buildReviewAppKey(app, "amd64")).toBe("apm:amd64-apm:office:wps");
|
expect(buildReviewAppKey(app, "amd64")).toBe("apm:amd64-apm:office:wps");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("builds review keys from already-qualified client arch values", () => {
|
||||||
|
expect(buildReviewAppKey({ ...app, origin: "spark" }, "amd64-store")).toBe(
|
||||||
|
"spark:amd64-store:office:wps",
|
||||||
|
);
|
||||||
|
expect(buildReviewAppKey(app, "amd64-apm")).toBe(
|
||||||
|
"apm:amd64-apm:office:wps",
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it("parses package arch and review tags", () => {
|
it("parses package arch and review tags", () => {
|
||||||
expect(parsePackageArch(app.filename)).toBe("amd64");
|
expect(parsePackageArch(app.filename)).toBe("amd64");
|
||||||
expect(
|
expect(
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ export const buildStoreArch = (
|
|||||||
origin: "spark" | "apm",
|
origin: "spark" | "apm",
|
||||||
clientArch: string,
|
clientArch: string,
|
||||||
): string => {
|
): string => {
|
||||||
return `${clientArch}-${origin === "spark" ? "store" : "apm"}`;
|
const rawArch = clientArch.replace(/-(store|apm)$/, "");
|
||||||
|
return `${rawArch}-${origin === "spark" ? "store" : "apm"}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const buildFavoriteAppKey = (app: App): string => {
|
export const buildFavoriteAppKey = (app: App): string => {
|
||||||
|
|||||||
Reference in New Issue
Block a user