mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-13 17:52:38 +02:00
test(e2e): wire ClickUp Playwright fixtures
This commit is contained in:
parent
e211028866
commit
68e1d78d23
4 changed files with 100 additions and 0 deletions
28
surfsense_web/tests/fixtures/connectors/clickup.fixture.ts
vendored
Normal file
28
surfsense_web/tests/fixtures/connectors/clickup.fixture.ts
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { type ConnectorRow, deleteConnector, runClickupOAuth } from "../../helpers/api/connectors";
|
||||
import { searchSpaceFixtures } from "../search-space.fixture";
|
||||
|
||||
export type ClickupFixtures = {
|
||||
/**
|
||||
* A pre-connected ClickUp connector inside the fixture's `searchSpace`.
|
||||
* OAuth and MCP tool calls use E2E ClickUp fakes and are cleaned up
|
||||
* automatically after the test.
|
||||
*/
|
||||
clickupConnector: ConnectorRow;
|
||||
};
|
||||
|
||||
export const clickupFixtures = searchSpaceFixtures.extend<ClickupFixtures>({
|
||||
clickupConnector: async ({ request, apiToken, searchSpace }, use) => {
|
||||
const { connector } = await runClickupOAuth(request, apiToken, searchSpace.id);
|
||||
if (!connector) {
|
||||
throw new Error(
|
||||
"clickupConnector fixture: OAuth completed but no CLICKUP_CONNECTOR was created. " +
|
||||
"Check the backend log — the ClickUp MCP fake likely rejected an unmodelled call."
|
||||
);
|
||||
}
|
||||
try {
|
||||
await use(connector);
|
||||
} finally {
|
||||
await deleteConnector(request, apiToken, connector.id);
|
||||
}
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue