test(web): add native Google Gmail live-tool journey

This commit is contained in:
Anish Sarkar 2026-05-07 04:23:20 +05:30
parent a5c04cb38d
commit 9dafd38e19
5 changed files with 183 additions and 1 deletions

View file

@ -20,7 +20,7 @@ export const nativeDriveFixtures = searchSpaceFixtures.extend<NativeDriveFixture
if (!connector) {
throw new Error(
"nativeDriveConnector fixture: OAuth completed but no GOOGLE_DRIVE_CONNECTOR was created. " +
"Check the backend log — the native Google Drive fake likely rejected an unmodelled call."
"Check the backend log — the native Google fake likely rejected an unmodelled call."
);
}
try {

View file

@ -0,0 +1,32 @@
import {
type ConnectorRow,
deleteConnector,
runNativeGoogleGmailOAuth,
} from "../../helpers/api/connectors";
import { searchSpaceFixtures } from "../search-space.fixture";
export type NativeGmailFixtures = {
/**
* A pre-connected native Google Gmail connector inside the fixture's
* `searchSpace`. OAuth uses E2E native Google fakes and is cleaned up
* automatically after the test.
*/
nativeGmailConnector: ConnectorRow;
};
export const nativeGmailFixtures = searchSpaceFixtures.extend<NativeGmailFixtures>({
nativeGmailConnector: async ({ request, apiToken, searchSpace }, use) => {
const { connector } = await runNativeGoogleGmailOAuth(request, apiToken, searchSpace.id);
if (!connector) {
throw new Error(
"nativeGmailConnector fixture: OAuth completed but no GOOGLE_GMAIL_CONNECTOR was created. " +
"Check the backend log — the native Google fake likely rejected an unmodelled call."
);
}
try {
await use(connector);
} finally {
await deleteConnector(request, apiToken, connector.id);
}
},
});