From 75b4b0b35039855ebaf37b01269e656aaf38c74c Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 19 Oct 2023 12:29:39 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=9F=20=F0=9F=94=A7=20Add=20`virtuoso`?= =?UTF-8?q?=20to=20Formik's=20``=20(#9214)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../connection/StreamDetailsPageObject.ts | 8 +- .../CreateConnectionForm.test.tsx | 9 +- .../CreateConnectionForm.test.tsx.snap | 648 +++++++++--------- .../SyncCatalog/SyncCatalogBody.tsx | 36 +- .../ConnectionReplicationPage.test.tsx | 5 +- .../ConnectionReplicationPage.test.tsx.snap | 648 +++++++++--------- 6 files changed, 725 insertions(+), 629 deletions(-) diff --git a/airbyte-webapp/cypress/pages/connection/StreamDetailsPageObject.ts b/airbyte-webapp/cypress/pages/connection/StreamDetailsPageObject.ts index f7fcd8aa96b..abbf332b053 100644 --- a/airbyte-webapp/cypress/pages/connection/StreamDetailsPageObject.ts +++ b/airbyte-webapp/cypress/pages/connection/StreamDetailsPageObject.ts @@ -83,11 +83,15 @@ export class StreamDetailsPageObject { } scrollToBottom() { - return cy.get("div[data-test-id='virtuoso-scroller']").scrollTo("bottom"); + return cy.get(streamDetailsPanel).within(() => { + cy.get("div[data-test-id='virtuoso-scroller']").scrollTo("bottom"); + }); } scrollToTop() { - return cy.get("div[data-test-id='virtuoso-scroller']").scrollTo("top"); + return cy.get(streamDetailsPanel).within(() => { + cy.get("div[data-test-id='virtuoso-scroller']").scrollTo("top"); + }); } enableSyncStream() { diff --git a/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.test.tsx b/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.test.tsx index de98e0ad4a7..db7d790d168 100644 --- a/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.test.tsx +++ b/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.test.tsx @@ -3,6 +3,7 @@ import { act, render as tlr } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import React from "react"; import selectEvent from "react-select-event"; +import { VirtuosoMockContext } from "react-virtuoso"; import { mockConnection } from "test-utils/mock-data/mockConnection"; import { @@ -58,7 +59,13 @@ jest.mock("hooks/theme/useAirbyteTheme", () => ({ jest.setTimeout(40000); describe("CreateConnectionForm", () => { - const Wrapper: React.FC> = ({ children }) => {children}; + const Wrapper: React.FC> = ({ children }) => ( + + + {children} + + + ); const render = async () => { let renderResult: ReturnType; diff --git a/airbyte-webapp/src/components/connection/CreateConnectionForm/__snapshots__/CreateConnectionForm.test.tsx.snap b/airbyte-webapp/src/components/connection/CreateConnectionForm/__snapshots__/CreateConnectionForm.test.tsx.snap index 4abf0fa94e5..24a8bce0f08 100644 --- a/airbyte-webapp/src/components/connection/CreateConnectionForm/__snapshots__/CreateConnectionForm.test.tsx.snap +++ b/airbyte-webapp/src/components/connection/CreateConnectionForm/__snapshots__/CreateConnectionForm.test.tsx.snap @@ -788,360 +788,398 @@ exports[`CreateConnectionForm should render 1`] = `
- -
-
-
- -

- '<destination schema> -

-
-
-
- -

- another_stream -

-
-
-
- +
+
+
+
+
+

+ All +

+
+
+
- -
-
-
-
-
-
-
-

- All -

-
-
-
-
-
- -
-
-
- -

- '<destination schema> -

-
-
-
- -

- pokemon -

-
-
-
-
- +
+
+
+
+
+

+ All +

+
+
+
- -
-
-
-
-
-
-
-

- All -

-
-
-
-
-
- -
-
-
- -

- '<destination schema> -

-
-
-
- -

- pokemon2 -

-
-
-
-
- +
+
+
+
+
+

+ All +

+
+
+
- -
-
-
-
-
-
-
-

- All -

diff --git a/airbyte-webapp/src/components/connection/syncCatalog/SyncCatalog/SyncCatalogBody.tsx b/airbyte-webapp/src/components/connection/syncCatalog/SyncCatalog/SyncCatalogBody.tsx index 5dadb9ecf90..d7ca5af47f6 100644 --- a/airbyte-webapp/src/components/connection/syncCatalog/SyncCatalog/SyncCatalogBody.tsx +++ b/airbyte-webapp/src/components/connection/syncCatalog/SyncCatalog/SyncCatalogBody.tsx @@ -1,5 +1,6 @@ import { Field, FieldProps, setIn } from "formik"; import React, { useCallback } from "react"; +import { Virtuoso } from "react-virtuoso"; import { FormikConnectionFormValues } from "components/connection/ConnectionForm/formConfig"; @@ -52,21 +53,26 @@ export const SyncCatalogBody: React.FC = ({ />
{streams.length ? ( - streams.map((streamNode) => ( - - {({ form }: FieldProps) => ( - - )} - - )) + ( + + {({ form }: FieldProps) => ( + + )} + + )} + /> ) : ( )} diff --git a/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/ConnectionReplicationPage.test.tsx b/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/ConnectionReplicationPage.test.tsx index d5c6ac8401e..2377dc580ac 100644 --- a/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/ConnectionReplicationPage.test.tsx +++ b/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/ConnectionReplicationPage.test.tsx @@ -5,6 +5,7 @@ import { render as tlr, act } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import React, { Suspense } from "react"; import selectEvent from "react-select-event"; +import { VirtuosoMockContext } from "react-virtuoso"; import { mockConnection } from "test-utils/mock-data/mockConnection"; import { @@ -67,7 +68,9 @@ describe("ConnectionReplicationPage", () => { I should not show up in a snapshot
}> - {children} + + {children} + diff --git a/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/__snapshots__/ConnectionReplicationPage.test.tsx.snap b/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/__snapshots__/ConnectionReplicationPage.test.tsx.snap index 3a37e06cdb4..094bcc9b4cc 100644 --- a/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/__snapshots__/ConnectionReplicationPage.test.tsx.snap +++ b/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/__snapshots__/ConnectionReplicationPage.test.tsx.snap @@ -349,360 +349,398 @@ exports[`ConnectionReplicationPage should render 1`] = `
-
-
-
- -

- '<destination schema> -

-
-
-
- -

- another_stream -

-
-
-
-
- +
+
+
+
+
+

+ All +

+
+
+
- -
-
-
-
-
-
-
-

- All -

-
-
-
-
-
- -
-
-
- -

- '<destination schema> -

-
-
-
- -

- pokemon -

-
-
-
-
- +
+
+
+
+
+

+ All +

+
+
+
- -
-
-
-
-
-
-
-

- All -

-
-
-
-
-
- -
-
-
- -

- '<destination schema> -

-
-
-
- -

- pokemon2 -

-
-
-
-
- +
+
+
+
+
+

+ All +

+
+
+
- -
-
-
-
-
-
-
-

- All -