mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-08 22:22:17 +02:00
feat: docs and ui tweaks
This commit is contained in:
parent
64f2b4a6eb
commit
271a21aee6
103 changed files with 2161 additions and 2625 deletions
|
|
@ -44,7 +44,7 @@ test.describe("ClickUp connector journey", () => {
|
|||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage External MCP Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
await expect(connectorDialog.getByText("ClickUp")).toBeVisible();
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ test.describe("Composio Calendar journey", () => {
|
|||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage External MCP Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
|
||||
const beforeChatDocs = await listDocuments(request, apiToken, workspace.id);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
} from "../../../helpers/api/connectors";
|
||||
import { getEditorContent, listDocuments } from "../../../helpers/api/documents";
|
||||
import { CANARY_TOKENS, FAKE_DRIVE_FILES } from "../../../helpers/canary";
|
||||
import { openConnectorPopup } from "../../../helpers/ui/connector-popup";
|
||||
import { expectImportConnectorAvailable } from "../../../helpers/ui/connector-popup";
|
||||
import { waitForDocumentByTitle, waitForIndexingComplete } from "../../../helpers/waits/indexing";
|
||||
|
||||
/**
|
||||
|
|
@ -31,9 +31,7 @@ test.describe("Composio Drive journey", () => {
|
|||
await page.goto(`/dashboard/${workspace.id}/new-chat`, {
|
||||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
await expectImportConnectorAvailable(page, "Google Drive");
|
||||
|
||||
const selectedFiles = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ test.describe("Composio Gmail journey", () => {
|
|||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage External MCP Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
|
||||
const beforeChatDocs = await listDocuments(request, apiToken, workspace.id);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ test.describe("Confluence connector journey", () => {
|
|||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage External MCP Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
await connectorDialog.getByPlaceholder("Search").fill("Confluence");
|
||||
await expect(connectorDialog.getByText("Confluence", { exact: true })).toBeVisible();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { streamChatToCompletion } from "../../helpers/api/chat";
|
|||
import { listConnectors, triggerIndex, updateConnectorConfig } from "../../helpers/api/connectors";
|
||||
import { getEditorContent, listDocuments } from "../../helpers/api/documents";
|
||||
import { CANARY_TOKENS, FAKE_DROPBOX_FILES } from "../../helpers/canary";
|
||||
import { openConnectorPopup } from "../../helpers/ui/connector-popup";
|
||||
import { expectImportConnectorAvailable } from "../../helpers/ui/connector-popup";
|
||||
import { waitForDocumentByTitle, waitForIndexingComplete } from "../../helpers/waits/indexing";
|
||||
|
||||
/**
|
||||
|
|
@ -32,9 +32,7 @@ test.describe("Native Dropbox journey", () => {
|
|||
await page.goto(`/dashboard/${workspace.id}/new-chat`, {
|
||||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
await expectImportConnectorAvailable(page, "Dropbox");
|
||||
|
||||
const selectedFiles = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ test.describe("Native Google Calendar journey", () => {
|
|||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage External MCP Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
|
||||
const beforeDocs = await listDocuments(request, apiToken, workspace.id);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
} from "../../../helpers/api/connectors";
|
||||
import { getEditorContent, listDocuments } from "../../../helpers/api/documents";
|
||||
import { CANARY_TOKENS, FAKE_DRIVE_FILES } from "../../../helpers/canary";
|
||||
import { openConnectorPopup } from "../../../helpers/ui/connector-popup";
|
||||
import { expectImportConnectorAvailable } from "../../../helpers/ui/connector-popup";
|
||||
import { waitForDocumentByTitle, waitForIndexingComplete } from "../../../helpers/waits/indexing";
|
||||
|
||||
/**
|
||||
|
|
@ -36,9 +36,7 @@ test.describe("Native Google Drive journey", () => {
|
|||
await page.goto(`/dashboard/${workspace.id}/new-chat`, {
|
||||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
await expectImportConnectorAvailable(page, "Google Drive");
|
||||
|
||||
const selectedFiles = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ test.describe("Native Google Gmail journey", () => {
|
|||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage External MCP Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
|
||||
const beforeDocs = await listDocuments(request, apiToken, workspace.id);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ test.describe("Jira connector journey", () => {
|
|||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage External MCP Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
await connectorDialog.getByPlaceholder("Search").fill("Jira");
|
||||
await expect(connectorDialog.getByText("Jira", { exact: true })).toBeVisible();
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ test.describe("Linear connector journey", () => {
|
|||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage External MCP Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
|
||||
const beforeDocs = await listDocuments(request, apiToken, workspace.id);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ test.describe("Notion connector journey", () => {
|
|||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage External MCP Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
await connectorDialog.getByPlaceholder("Search").fill("Notion");
|
||||
await expect(connectorDialog.getByText("Notion", { exact: true })).toBeVisible();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { streamChatToCompletion } from "../../helpers/api/chat";
|
|||
import { listConnectors, triggerIndex, updateConnectorConfig } from "../../helpers/api/connectors";
|
||||
import { getEditorContent, listDocuments } from "../../helpers/api/documents";
|
||||
import { CANARY_TOKENS, FAKE_ONEDRIVE_FILES } from "../../helpers/canary";
|
||||
import { openConnectorPopup } from "../../helpers/ui/connector-popup";
|
||||
import { expectImportConnectorAvailable } from "../../helpers/ui/connector-popup";
|
||||
import { waitForDocumentByTitle, waitForIndexingComplete } from "../../helpers/waits/indexing";
|
||||
|
||||
/**
|
||||
|
|
@ -32,9 +32,7 @@ test.describe("Native OneDrive journey", () => {
|
|||
await page.goto(`/dashboard/${workspace.id}/new-chat`, {
|
||||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
await expectImportConnectorAvailable(page, "OneDrive");
|
||||
|
||||
const selectedFiles = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ test.describe("Slack connector journey", () => {
|
|||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await openConnectorPopup(page);
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage Connectors" });
|
||||
const connectorDialog = page.getByRole("dialog", { name: "Manage External MCP Connectors" });
|
||||
await expect(connectorDialog).toBeVisible();
|
||||
await connectorDialog.getByPlaceholder("Search").fill("Slack");
|
||||
await expect(connectorDialog.getByText("Slack", { exact: true })).toBeVisible();
|
||||
|
|
|
|||
|
|
@ -21,14 +21,27 @@ export async function openConnectorPopup(page: Page): Promise<void> {
|
|||
await expect(trigger).toBeVisible({ timeout: 60_000 });
|
||||
await trigger.click();
|
||||
|
||||
await expect(page.getByRole("dialog", { name: "Manage Connectors" })).toBeVisible();
|
||||
await expect(page.getByRole("dialog", { name: "Manage External MCP Connectors" })).toBeVisible();
|
||||
}
|
||||
|
||||
export async function clickComposioDriveCard(page: Page): Promise<void> {
|
||||
const composioDriveCard = page.getByText("Search your Drive files via Composio");
|
||||
await composioDriveCard.scrollIntoViewIfNeeded();
|
||||
const card = composioDriveCard
|
||||
.locator("xpath=ancestor::*[self::article or self::div][1]")
|
||||
.first();
|
||||
await card.getByRole("button", { name: "Connect" }).click();
|
||||
/**
|
||||
* Opens the Documents sidebar "Import" menu. Import connectors
|
||||
* (Google Drive / OneDrive / Dropbox) are surfaced here instead of in the
|
||||
* external-MCP connector catalog.
|
||||
*/
|
||||
export async function openDocumentsImportMenu(page: Page): Promise<void> {
|
||||
const trigger = page.getByRole("button", { name: "Import documents" }).first();
|
||||
// Long timeout absorbs Next.js dev cold-compile of the dashboard route.
|
||||
await expect(trigger).toBeVisible({ timeout: 60_000 });
|
||||
await trigger.click();
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the Import menu and asserts a cloud-drive import connector is offered.
|
||||
* `label` is the visible menu label ("Google Drive", "OneDrive", "Dropbox").
|
||||
*/
|
||||
export async function expectImportConnectorAvailable(page: Page, label: string): Promise<void> {
|
||||
await openDocumentsImportMenu(page);
|
||||
await expect(page.getByRole("menuitem", { name: label })).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue