style: show spread threshold units

This commit is contained in:
wxs
2026-06-30 17:56:49 +08:00
parent 4b5515f6ec
commit 4c66262211
2 changed files with 48 additions and 26 deletions
+25 -1
View File
@@ -436,6 +436,12 @@ describe("market-content-entry", () => {
const conjunctions = Array.from(
document.querySelectorAll("[data-plugin-spread-threshold-conjunction]")
).map((element) => element.textContent);
const thresholdControls = Array.from(
document.querySelectorAll("[data-plugin-spread-threshold-control]")
);
const thresholdInputs = Array.from(
document.querySelectorAll("[data-plugin-spread-threshold]")
) as HTMLInputElement[];
expect(toolbar?.style.flexWrap).toBe("nowrap");
expect(panel?.style.flexDirection).toBe("column");
@@ -465,6 +471,24 @@ describe("market-content-entry", () => {
).toContain("每项取值 >= 输入值");
expect(operators).toEqual(["≥", "≥", "≥", "≥", "≥", "≥", "≥"]);
expect(conjunctions).toEqual(["且", "且", "且", "且", "且", "且"]);
expect(thresholdInputs.map((input) => input.placeholder)).toEqual([
"",
"",
"",
"",
"",
"",
""
]);
expect(thresholdControls.map((control) => control.textContent)).toEqual([
"评论≥条",
"时长≥秒",
"点赞≥次",
"转发≥次",
"完播率≥%",
"互动率≥%",
"播放中位数≥次"
]);
expect(buttons.map((button) => button.style.backgroundColor)).toEqual([
"rgb(127, 29, 45)",
"rgb(127, 29, 45)",
@@ -1294,7 +1318,7 @@ describe("market-content-entry", () => {
expect(assignSelect?.disabled).toBe(true);
expect(flowTypeSelect?.value).toBe("0");
expect(flowTypeSelect?.disabled).toBe(true);
expect(finishRateInput?.placeholder).toBe("完播率>=");
expect(finishRateInput?.placeholder).toBe("");
setSelectValue('[data-plugin-spread-filter="type"]', "2");
dispatchChange('[data-plugin-spread-filter="type"]');