feat: merge market core user id flow
This commit is contained in:
@@ -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"
|
||||
})
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user