Skip to content

Commit

Permalink
fix typo in Grid.jest.js (bvaughn#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihgwu authored and TrySound committed Feb 26, 2018
1 parent e775173 commit 8b6b911
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions source/Grid/Grid.jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,16 @@ describe('Grid', () => {

it('should scroll over to the middle', () => {
const grid = render(getMarkup({scrollToColumn: 24}));
// 100 columns * 50 item width = 5,000 total item width
// 50 columns * 50 item width = 2,500 total item width
// 4 columns can be visible at a time and :scrollLeft is initially 0,
// So the minimum amount of scrolling leaves the 25th item at the right (just scrolled into view).
expect(grid.state.scrollLeft).toEqual(1050);
});

it('should scroll to the far right', () => {
const grid = render(getMarkup({scrollToColumn: 49}));
// 100 columns * 50 item width = 5,000 total item width
// Target offset for the last item then is 5,000 - 200
// 50 columns * 50 item width = 2,500 total item width
// Target offset for the last item then is 2,500 - 200
expect(grid.state.scrollLeft).toEqual(2300);
});

Expand Down Expand Up @@ -394,7 +394,7 @@ describe('Grid', () => {
scrollToRow: 49,
}),
);
// 100 columns * 50 item width = 5,000 total item width
// 50 columns * 50 item width = 2,500 total item width
// 100 rows * 20 item height = 2,000 total item height
// 4 columns and 5 rows can be visible at a time.
// The minimum amount of scrolling leaves the specified cell in the bottom/right corner (just scrolled into view).
Expand All @@ -417,7 +417,7 @@ describe('Grid', () => {
scrollToRow: 49,
}),
);
// 100 columns * 50 item width = 5,000 total item width
// 50 columns * 50 item width = 2,500 total item width
// 100 rows * 20 item height = 2,000 total item height
// We first scroll past the specified cell and then back.
// The minimum amount of scrolling then should leave the specified cell in the top/left corner (just scrolled into view).
Expand All @@ -440,7 +440,7 @@ describe('Grid', () => {
scrollToRow: 49,
}),
);
// 100 columns * 50 item width = 5,000 total item width
// 50 columns * 50 item width = 2,500 total item width
// Viewport width is 200
// Column 24 starts at 1,200, center point at 1,225, so...
expect(grid.state.scrollLeft).toEqual(1125);
Expand Down Expand Up @@ -532,7 +532,7 @@ describe('Grid', () => {
columnIndex: 24,
rowIndex: 49,
});
// 100 columns * 50 item width = 5,000 total item width
// 50 columns * 50 item width = 2,500 total item width
// 4 columns can be visible at a time and :scrollLeft is initially 0,
// So the minimum amount of scrolling leaves the 25th item at the right (just scrolled into view).
expect(grid.state.scrollLeft).toEqual(1050);
Expand Down Expand Up @@ -603,7 +603,7 @@ describe('Grid', () => {
columnIndex: 24,
rowIndex: 49,
});
// 100 columns * 50 item width = 5,000 total item width
// 50 columns * 50 item width = 2,500 total item width
// 4 columns can be visible at a time and :scrollLeft is initially 0,
// So the minimum amount of scrolling leaves the 25th item at the right (just scrolled into view).
expect(scrollLeft).toEqual(1050);
Expand Down

0 comments on commit 8b6b911

Please sign in to comment.