Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion vuu-ui/packages/vuu-data-test/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from "./ArrayProxy";
export * from "./schemas";
export * from "./TickingArrayDataSource";
export * from "./vuu-row-generator";
export * from "./vuu-modules";
export * from "./simul";
export * from "./basket";
export * from "./test";
Expand Down
29 changes: 0 additions & 29 deletions vuu-ui/packages/vuu-data-test/src/vuu-modules.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
assertRenderedRows,
withAriaRowIndex,
} from "./table-test-utils";
import { LocalDataSourceProvider } from "@vuu-ui/vuu-data-test";

describe("Table scrolling and keyboard navigation", () => {
const RENDER_BUFFER = 5;
Expand All @@ -21,7 +22,11 @@ describe("Table scrolling and keyboard navigation", () => {
describe("Page Keys", () => {
describe("WHEN first cell is focussed and page down pressed", () => {
it("THEN table scrolls down and next page of rows are rendered, first cell of new page is focussed", () => {
cy.mount(<TestTable {...tableConfig} />);
cy.mount(
<LocalDataSourceProvider>
<TestTable {...tableConfig} />
</LocalDataSourceProvider>,
);

// interestingly, realClick doesn't work here
cy.findByRole("cell", { name: "row 1" }).click();
Expand Down Expand Up @@ -62,7 +67,11 @@ describe("Table scrolling and keyboard navigation", () => {

describe("AND WHEN page up is then pressed", () => {
it("THEN table is back to original state, and first cell is once again focussed", () => {
cy.mount(<TestTable {...tableConfig} />);
cy.mount(
<LocalDataSourceProvider>
<TestTable {...tableConfig} />
</LocalDataSourceProvider>,
);

// interestingly, realClick doesn't work here
cy.findByRole("cell", { name: "row 1" }).click();
Expand All @@ -87,7 +96,11 @@ describe("Table scrolling and keyboard navigation", () => {
describe("Home / End Keys", () => {
describe("WHEN topmost rows are in viewport, first cell is focussed and Home key pressed ", () => {
it("THEN nothing changes", () => {
cy.mount(<TestTable {...tableConfig} />);
cy.mount(
<LocalDataSourceProvider>
<TestTable {...tableConfig} />
</LocalDataSourceProvider>,
);
// interestingly, realClick doesn't work here
cy.findByRole("cell", { name: "row 1" }).click();
cy.realPress("Home");
Expand All @@ -102,7 +115,11 @@ describe("Table scrolling and keyboard navigation", () => {
});
describe("WHEN topmost rows are in viewport, cell in middle of viewport is focussed and Home key pressed ", () => {
it("THEN no scrolling, but focus moves to first cell", () => {
cy.mount(<TestTable {...tableConfig} />);
cy.mount(
<LocalDataSourceProvider>
<TestTable {...tableConfig} />
</LocalDataSourceProvider>,
);
// interestingly, realClick doesn't work here
cy.findByRole("cell", { name: "row 5" }).click();
cy.realPress("Home");
Expand All @@ -118,7 +135,11 @@ describe("Table scrolling and keyboard navigation", () => {

describe("WHEN topmost rows are in viewport, first cell is focussed and End key pressed ", () => {
it("THEN scrolls to end of data, last cell is focussed (same column)", () => {
cy.mount(<TestTable {...tableConfig} />);
cy.mount(
<LocalDataSourceProvider>
<TestTable {...tableConfig} />
</LocalDataSourceProvider>,
);
// interestingly, realClick doesn't work here
cy.findByRole("cell", { name: "row 1" }).click();
cy.realPress("End");
Expand All @@ -134,7 +155,11 @@ describe("Table scrolling and keyboard navigation", () => {

describe("WHEN topmost rows are in viewport, cell mid viewport focussed and End key pressed ", () => {
it("THEN scrolls to end of data, last cell is focussed (same column)", () => {
cy.mount(<TestTable {...tableConfig} />);
cy.mount(
<LocalDataSourceProvider>
<TestTable {...tableConfig} />
</LocalDataSourceProvider>,
);
// interestingly, realClick doesn't work here
cy.findByRole("cell", { name: "row 10" }).click();
cy.realPress("End");
Expand All @@ -152,7 +177,11 @@ describe("Table scrolling and keyboard navigation", () => {
describe("Arrow Up / Down Keys", () => {
describe("WHEN topmost rows are in viewport, first cell is focussed and Down Arrow key pressed ", () => {
it("THEN no scrolling, focus moved down to next cell", () => {
cy.mount(<TestTable {...tableConfig} />);
cy.mount(
<LocalDataSourceProvider>
<TestTable {...tableConfig} />
</LocalDataSourceProvider>,
);
// interestingly, realClick doesn't work here
cy.findByRole("cell", { name: "row 1" }).click();
cy.realPress("ArrowDown");
Expand All @@ -167,7 +196,11 @@ describe("Table scrolling and keyboard navigation", () => {
});
describe("WHEN topmost rows are in viewport, first cell in last row is focussed and Down Arrow key pressed ", () => {
it("THEN scroll down by 1 row, cell in bottom row has focus", () => {
cy.mount(<TestTable {...tableConfig} />);
cy.mount(
<LocalDataSourceProvider>
<TestTable {...tableConfig} />
</LocalDataSourceProvider>,
);
// interestingly, realClick doesn't work here
cy.findByRole("cell", { name: "row 30" }).click();
cy.realPress("ArrowDown");
Expand All @@ -185,7 +218,11 @@ describe("Table scrolling and keyboard navigation", () => {
describe("scrolling with Scrollbar", () => {
describe("WHEN scrolled down by a distance equating to 500 rows", () => {
it.skip("THEN correct rows are within viewport", () => {
cy.mount(<TestTable {...tableConfig} />);
cy.mount(
<LocalDataSourceProvider>
<TestTable {...tableConfig} />
</LocalDataSourceProvider>,
);
cy.get(".vuuTable-scrollbarContainer").scrollTo(0, 10000);
assertRenderedRows({ from: 500, to: 530 }, RENDER_BUFFER, ROW_COUNT);
});
Expand All @@ -197,7 +234,11 @@ describe("Table scrolling and keyboard navigation", () => {
it("THEN only those columns within the viewport are rendered", () => {
// this width allows for exactly 6 visible columns, we allow a buffer of 200px
// so 2 out-of-viewport colums are rendered
cy.mount(<TwoHundredColumns width={914} />);
cy.mount(
<LocalDataSourceProvider>
<TwoHundredColumns width={914} />
</LocalDataSourceProvider>,
);
assertRenderedColumns({
rendered: { from: 1, to: 8 },
visible: { from: 1, to: 6 },
Expand All @@ -207,7 +248,11 @@ describe("Table scrolling and keyboard navigation", () => {

describe("WHEN table is scrolled horizontally no more than 100px", () => {
it("THEN rendering is unchanged", () => {
cy.mount(<TwoHundredColumns width={914} />);
cy.mount(
<LocalDataSourceProvider>
<TwoHundredColumns width={914} />
</LocalDataSourceProvider>,
);
cy.get(".vuuTable-scrollbarContainer").scrollTo(100, 0);
assertRenderedColumns({
rendered: { from: 1, to: 8 },
Expand All @@ -218,7 +263,11 @@ describe("Table scrolling and keyboard navigation", () => {

describe("WHEN table is scrolled beyond the 100px buffer", () => {
it("THEN additional column(s) are rendered", () => {
cy.mount(<TwoHundredColumns width={915} />);
cy.mount(
<LocalDataSourceProvider>
<TwoHundredColumns width={915} />
</LocalDataSourceProvider>,
);
cy.get(".vuuTable-scrollbarContainer").scrollTo(110, 0);
assertRenderedColumns({
rendered: { from: 1, to: 9 },
Expand All @@ -230,7 +279,11 @@ describe("Table scrolling and keyboard navigation", () => {

describe("WHEN table is scrolled exactly one viewport width", () => {
it("THEN next set of columns are rendered", () => {
cy.mount(<TwoHundredColumns width={915} />);
cy.mount(
<LocalDataSourceProvider>
<TwoHundredColumns width={915} />
</LocalDataSourceProvider>,
);
cy.get(".vuuTable-scrollbarContainer").scrollTo(900, 0);
assertRenderedColumns({
rendered: { from: 6, to: 14 },
Expand Down
Loading
Loading