You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 97c8af9
Browse filesBrowse the repository at this point in the historyBrowse files
test(web): the end-to-end check also covers Keep and Undo, and runs against a release
Undo of a file the agent created removes it, and so does everything else still pending from the
session; Keep clears the bar. The account card that sign-in leaves open is closed the way a user
would, before the chat is clicked.
check('the chat offers Keep and Undo for it',(awaitinChat(`getComputedStyle(d.getElementById('reviewBar')).display !== 'none' && !!d.querySelector('#reviewBar .keepall') && !!d.querySelector('#reviewBar .undoall')`))===true);
214
+
awaitshot(page,'3c-review');
215
+
awaitclickInChat('#reviewBar .undoall');
216
+
awaitsleep(2000);
217
+
check('Undo all removes the file the agent created',(awaitscratchFile('/scratch/notes.md'))===null);
218
+
check('and everything else still pending: hello.txt, created and edited earlier in the session, is gone too',(awaitscratchFile('/scratch/hello.txt'))===null);
check('Keep all keeps it, and the review bar goes away',(awaitscratchFile('/scratch/notes.md'))==='notes\n'&&(awaitinChat(`getComputedStyle(d.getElementById('reviewBar')).display === 'none'`))===true);
Copy file name to clipboardExpand all lines: web/test/stub-backend.mjs
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,11 @@ export function defaultModel(messages) {
52
52
if(/\bcreate\b/i.test(text)){returncall('write_file',{path: 'hello.txt',content: 'hello from the browser\n',explanation: 'Create the greeting file'},'I will create the file now.');}
53
53
if(/\blist\b/i.test(text)){returncall('list_files',{},'Let me look at the files.');}
54
54
if(/\bsearch\b/i.test(text)){returncall('search',{query: 'hello',explanation: 'Find the greeting'},'Searching.');}
55
-
if(/\bread\b/i.test(text)){returncall('read_file',{path: 'hello.txt',explanation: 'Read the greeting file'},'Reading it.');}
55
+
if(/\bmake\b/i.test(text)){returncall('write_file',{path: 'notes.md',content: 'notes\n',explanation: 'Make the notes file'},'Making it.');}
returncall('read_file',{path: named ? named[1] : 'hello.txt',explanation: 'Read the file'},'Reading it.');
59
+
}
56
60
if(/\bchange\b/i.test(text)){returncall('edit_file',{path: 'hello.txt',old_str: 'hello from the browser',new_str: 'hello again',explanation: 'Change the greeting'},'Changing it.');}
0 commit comments