Fix Stories navigation, sharing, and voice entry

This commit is contained in:
Manjunath committed 2026-11-16 20:12:10 +05:30
1 parent 5418438339
commit 9e9ce1db22
43 files changed
+744 -137

No files matched your search

+14 -4
View File
@@ -429,12 +429,13 @@ test('a late rejection cannot settle a newer turn card', async () => {
f.session.destroy();
});
function startReentrancyFixture() {
function startReentrancyFixture(canStart) {
let starts = 0;
let stops = 0;
const settings = [];
const session = createVoiceSession({
runner: async () => ({ ok: true }),
canStart,
createAdapter: ({ emit }) => ({
async start(options) {
starts++;
@@ -515,9 +516,18 @@ test('Stop and explicit reentrant successor start acquire only for the successor
f.session.destroy();
});
test('ordinary start forwards caller settings once and remains stoppable', async () => {
const f = startReentrancyFixture();
const settings = { pushToTalk: true };
test('start admission rejects microphone use before connecting and allows typed chat', async () => {
const f = startReentrancyFixture((options) => options?.textOnly === true);
const states = [];
f.session.subscribe((event) => {
if (event.type === 'state') states.push(event.state);
});
await f.session.start({ pushToTalk: true });
assert.equal(f.starts(), 0);
assert.equal(f.session.state, 'idle');
assert.equal(states.includes('connecting'), false);
const settings = { textOnly: true };
await f.session.start(settings);
assert.equal(f.settings.length, 1);
assert.equal(f.settings[0], settings);