release: 0.2.0421.2

This commit is contained in:
2026-04-21 17:10:06 +08:00
parent 55324a5bb7
commit 968cc88c62
19 changed files with 2832 additions and 178 deletions
+35
View File
@@ -5,6 +5,9 @@ import { beforeEach, describe, expect, test } from "vitest";
import {
applyRowOrder,
applyRowVisibility,
findNextPageControl,
isPageControlDisabled,
readMarketPageSignature,
renderMarketRowState,
syncMarketTable
} from "../src/content/market/dom-sync";
@@ -154,6 +157,11 @@ describe("market-dom-sync", () => {
expect(readAuthorNames()).toEqual(["达人 B", "达人 A"]);
expect(readRightRowTexts(0)).toEqual(["¥20,000", "", "", "下单"]);
expect(table.rows[0].exportFields).toMatchObject({
"21-60s报价": "¥450,000",
"代表视频": "代表视频A",
"达人信息": "达人 A"
});
});
test("falls back to the market vue state when the DOM has no author id", () => {
@@ -208,6 +216,33 @@ describe("market-dom-sync", () => {
singleVideoAfterSearchRate: "0.02%"
});
});
test("finds the real next-page button in Xingtu pagination", () => {
document.body.innerHTML = `
${buildRealMarketGridFixture()}
<div class="pagination xt-space xt-space--medium">
<div class="el-pagination is-background xt-pagination xt-pagination--normal">
<button type="button" disabled="disabled" class="btn-prev">
<i class="el-icon el-icon-arrow-left"></i>
</button>
<ul class="el-pager">
<li class="number active">1</li>
<li class="number">2</li>
</ul>
<button type="button" class="btn-next">
<i class="el-icon el-icon-arrow-right"></i>
</button>
</div>
</div>
`;
const nextControl = findNextPageControl(document);
expect(nextControl).not.toBeNull();
expect(nextControl?.className).toContain("btn-next");
expect(isPageControlDisabled(nextControl)).toBe(false);
expect(readMarketPageSignature(document)).toContain("1::111|222");
});
});
function buildRealMarketGridFixture() {