Files
TamaASR/test/speech-session-state.test.ts
T
MeloriseandCodex 4a5a8dc8dd feat: 发布 MeloASR 0.1.7
整合 Linux Fcitx5 实时输入、网页后端、设置页、悬浮球、托盘和发行打包能力。

AI-assisted-by: Codex

AI-model: gpt-5.6-sol

AI-reasoning-effort: medium

Co-authored-by: Codex <codex@openai.com>
2026-08-23 17:23:33 +08:00

16 lines
626 B
TypeScript

import assert from 'node:assert/strict';
import test from 'node:test';
import { shouldClickMicrophoneOnCancel } from '../src/preload/speech-session-state';
test('停止命令已经点击过麦克风后,取消不得再次点击并重新开启录音', () => {
assert.equal(shouldClickMicrophoneOnCancel(true, true), false);
});
test('录音期间直接取消时仍应点击麦克风停止网页录音', () => {
assert.equal(shouldClickMicrophoneOnCancel(true, false), true);
});
test('本地会话未激活时取消不得点击麦克风', () => {
assert.equal(shouldClickMicrophoneOnCancel(false, false), false);
});