mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-18 14:08:21 +00:00
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Vote Gate / Gate (push) Waiting to run
Codegraph E2E Votes / vote (shard 1/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 10/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 2/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 3/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 4/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 5/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 6/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 7/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 8/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 9/10) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/chat (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
* refactor: Move Composer Input Controls and Shortcut Helpers Into @librechat/chat * test: Cover Interrupt Now on a Queued Composer Row * test: Read the Moved Escalate Button in the Composer Color Guardrail * refactor: Reuse the Core Draft Check for the Send Button * fix: Point the Acceptance Harness at the Moved Composer Shortcuts
33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
import test from 'node:test';
|
|
import { runInNewContext } from 'node:vm';
|
|
import assert from 'node:assert/strict';
|
|
import { initializeBrowser } from './browser.mjs';
|
|
import { resolveComposerKeyDown } from '../../packages/chat/src/core/shortcuts.ts';
|
|
|
|
const enter = { key: 'Enter', ctrlKey: false, metaKey: false, altKey: false, shiftKey: false };
|
|
const context = {
|
|
isComposing: false,
|
|
isSubmitting: false,
|
|
allowSubmitWhileGenerating: false,
|
|
hasDuringRunModifier: false,
|
|
shortcutsEnabled: true,
|
|
submitOverride: undefined,
|
|
yieldedChords: new Set(),
|
|
};
|
|
|
|
test('native acceptance opts into Enter submission before navigation and after reload', () => {
|
|
const values = new Map();
|
|
const localStorage = { setItem: (key, value) => values.set(key, value) };
|
|
const action = () =>
|
|
resolveComposerKeyDown(enter, {
|
|
...context,
|
|
enterToSend: JSON.parse(values.get('enterToSend') ?? 'false'),
|
|
});
|
|
|
|
assert.equal(action(), 'newline');
|
|
for (let navigation = 0; navigation < 2; navigation++) {
|
|
runInNewContext(`(${initializeBrowser.toString()})()`, { localStorage });
|
|
assert.equal(values.get('enterToSend'), 'true');
|
|
assert.equal(action(), 'submit');
|
|
}
|
|
});
|