Files
codex-market-app/test/codex-desktop.test.js
T

33 lines
1.1 KiB
JavaScript

"use strict";
const test = require("node:test");
const assert = require("node:assert/strict");
const codexDesktop = require("../electron/lib/codex_desktop");
test("native dictation cleanup moves only the bounded Codex dialog off-screen", async () => {
let command = null;
const result = await codexDesktop.hideGlobalDictationWindows({
execFile(file, args, options, callback) {
command = { file, args, options };
callback(null, "2\n", "");
},
});
if (process.platform === "darwin") {
assert.equal(result.ok, true);
assert.equal(result.status, "hidden");
assert.equal(result.hidden, 2);
assert.equal(command.file, "osascript");
assert.deepEqual(command.args.slice(0, 1), ["-e"]);
assert.match(command.args[1], /titleText is "Codex"/);
assert.match(command.args[1], /subroleText is "AXDialog"/);
assert.match(command.args[1], /set position of w to \{-10000, -10000\}/);
} else {
assert.equal(result.ok, false);
assert.equal(result.status, "unsupported-platform");
assert.equal(result.hidden, 0);
assert.equal(command, null);
}
});