Skip to content

Commit fcd373f

Browse files
committed
test(minimax-bot): 群纪要的记录在开关关着时仍然看得见、也清得掉
1 parent ad5a58b commit fcd373f

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

‎plugins/minimax-ai/minimax-bot/tests/panels-reliability.test.mjs‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,30 @@ test('durable task cards distinguish paused, unconfirmed and waiting states with
298298
assert.match(document.querySelector('.task-list').textContent,/Research/);
299299
closeOverlay();state.tasks=[];
300300
});
301+
302+
test('the group note record stays visible and clearable while the switch is off', async () => {
303+
requests = [];
304+
state.groups = [{
305+
id: 'g1', name: 'Team', notice: '', adminId: 'b1', memberIds: ['b1'], replyMode: 'admin',
306+
notes: false, noteEntries: [{ speaker: 'Rob', text: 'we go with plan B' }],
307+
}];
308+
state.current = 'group:g1';
309+
state.drawer = { open: true, view: 'overview', memTab: 'self', dirty: false };
310+
renderDrawer(); await tick();
311+
const drawer = document.getElementById('drawer');
312+
// The record is shown even though the switch is off: what was recorded has to stay readable.
313+
assert.match(drawer.textContent, /we go with plan B/);
314+
assert.match(drawer.textContent, /neither added to nor read by the Bots/);
315+
// And it can still be cleared.
316+
const clear = [...drawer.querySelectorAll('button')].find((button) => button.textContent.includes('Clear the note'));
317+
assert.ok(clear, 'the record can still be cleared');
318+
clear.click(); await tick();
319+
const cleared = requests.find((r) => r.url.includes('/api/groups/g1') && r.method === 'PATCH');
320+
assert.ok(cleared, 'clearing goes to the group API');
321+
assert.deepEqual(cleared.body, { clearNotes: true });
322+
// With the switch on, the panel does not claim the record is kept.
323+
state.groups[0].notes = true;
324+
renderDrawer(); await tick();
325+
assert.doesNotMatch(document.getElementById('drawer').textContent, /neither added to nor read/);
326+
state.groups = []; state.current = 'bot:b1';
327+
});

0 commit comments

Comments
 (0)