fix: refresh favorite identity from market bridge

This commit is contained in:
wxs
2026-07-17 16:54:19 +08:00
parent ddf9a75e82
commit 9ed2c23230
2 changed files with 33 additions and 12 deletions
+3 -11
View File
@@ -4658,8 +4658,8 @@ describe("market-content-entry", () => {
});
test("preserves a late serialized core user id through favorite batch import", async () => {
document.body.innerHTML = buildRealMarketFixtureWithoutAuthorIds([
{ authorName: "达人 A", price21To60s: "¥11,000" }
document.body.innerHTML = buildRealMarketFixture([
{ authorId: "111", authorName: "达人 A", price21To60s: "¥11,000" }
]);
const repository = createTestFavoritesRepository();
const observer = createMutationObserverFactory();
@@ -4687,16 +4687,8 @@ describe("market-content-entry", () => {
{ authorId: "111", authorName: "达人 A", coreUserId: "core-111" }
])
);
document.documentElement.setAttribute("data-test-page-index", "2");
observer.trigger();
await waitForCondition(
() => {
const favoriteButton = document.querySelector(
'[data-sces-favorite-row-action="button"]'
);
return favoriteButton instanceof HTMLButtonElement && !favoriteButton.disabled;
}
);
await flushWithTimers();
click('[data-sces-favorite-row-action="button"]');
click('[data-sces-favorite-row-picker="create-folder"]');