Skip to content

Commit 1a50d2b

Browse files
committed
test(shell): 补暂停键名翻转的同步判据
1 parent 25a4a2e commit 1a50d2b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎app/src/shell/LiveBar.test.tsx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,18 @@ describe("L4 · paused 的三处语义(受控:本件不自己翻转状态)
146146
LIVE_PAUSE_LABELS.paused,
147147
);
148148
});
149+
150+
it("可访问名与 `data-paused` **必须同步翻转**(只翻其中一个 ⇒ 本条红 —— 名翻转本身有牙)", () => {
151+
const pairs = [false, true].map((p) => {
152+
cleanup();
153+
const el = renderBar({ paused: p });
154+
return [el.getAttribute("data-paused"), byId("live-pause").textContent];
155+
});
156+
expect(pairs, "逐序成对 [data-paused, 可访问名]:两态都必须换(只翻属性不换名 = 屏幕阅读器读到旧动作)").toEqual([
157+
["false", LIVE_PAUSE_LABELS.running],
158+
["true", LIVE_PAUSE_LABELS.paused],
159+
]);
160+
});
149161
});
150162

151163
describe("L5 · live:audio-level 接线(内部订阅)与卸载退订", () => {

0 commit comments

Comments
 (0)