Skip to content

Commit

Permalink
🪟 🔧 Add virtuoso to Formik's <syncCatalog /> (#9214)
Browse files Browse the repository at this point in the history
  • Loading branch information
dizel852 committed Oct 19, 2023
1 parent be1d8e2 commit 75b4b0b
Show file tree
Hide file tree
Showing 6 changed files with 725 additions and 629 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -58,7 +59,13 @@ jest.mock("hooks/theme/useAirbyteTheme", () => ({
jest.setTimeout(40000);

describe("CreateConnectionForm", () => {
const Wrapper: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => <TestWrapper>{children}</TestWrapper>;
const Wrapper: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => (
<TestWrapper>
<VirtuosoMockContext.Provider value={{ viewportHeight: 1000, itemHeight: 50 }}>
{children}
</VirtuosoMockContext.Provider>
</TestWrapper>
);
const render = async () => {
let renderResult: ReturnType<typeof tlr>;

Expand Down
Loading

0 comments on commit 75b4b0b

Please sign in to comment.