feat: merge market core user id flow

This commit is contained in:
2026-05-11 10:22:45 +08:00
parent 2e049ef718
commit 1de508f2c7
14 changed files with 90 additions and 4 deletions
+38
View File
@@ -126,4 +126,42 @@ describe("market-page-bridge", () => {
})
);
});
test("serializes core user ids from the live market list", async () => {
const marketRoot = document.querySelector(".base-author-list") as HTMLElement & {
__vue__?: {
_setupState?: Record<string, unknown>;
};
};
marketRoot.__vue__ = {
_setupState: {
marketState: {
marketList: [
{
attribute_datas: {
avg_search_after_view_rate_30d: "0.1234",
core_user_id: "core-111",
nickname: "搜索达人"
},
star_id: "search-1"
}
]
}
}
};
await import("../src/content/market/page-bridge");
expect(
JSON.parse(
document.documentElement.getAttribute("data-sces-market-rows") ?? "[]"
)
).toEqual([
expect.objectContaining({
authorId: "search-1",
authorName: "搜索达人",
coreUserId: "core-111"
})
]);
});
});