Simplify auth in interactive tests. (#10921)

This commit is contained in:
Tommaso Sciortino
2025-10-10 14:50:14 -07:00
committed by GitHub
parent a6e00d9183
commit a64bb433b0
4 changed files with 48 additions and 148 deletions
@@ -23,23 +23,7 @@ describe('Interactive file system', () => {
rig.setup('interactive-read-then-write');
rig.createFile(fileName, '1.0.0');
const { ptyProcess } = rig.runInteractive();
const authDialogAppeared = await rig.waitForText(
'How would you like to authenticate',
5000,
);
// select the second option if auth dialog come's up
if (authDialogAppeared) {
ptyProcess.write('2');
}
// Wait for the app to be ready
const isReady = await rig.waitForText('Type your message', 30000);
expect(isReady, 'CLI did not start up in interactive mode correctly').toBe(
true,
);
const ptyProcess = await rig.runInteractive();
// Step 1: Read the file
const readPrompt = `Read the version from ${fileName}`;
@@ -49,11 +33,7 @@ describe('Interactive file system', () => {
const readCall = await rig.waitForToolCall('read_file', 30000);
expect(readCall, 'Expected to find a read_file tool call').toBe(true);
const containsExpectedVersion = await rig.waitForText('1.0.0', 30000);
expect(
containsExpectedVersion,
'Expected to see version "1.0.0" in output',
).toBe(true);
await rig.waitForText('1.0.0', 30000);
// Step 2: Write the file
const writePrompt = `now change the version to 1.0.1 in the file`;