Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyenwei committed Mar 20, 2024
1 parent 564e52c commit d0ccf02
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ describe('two column layout test cases', () => {
]);
});

test('returns positions for all items when two columns item is on a large batch', () => {
test('correctly positions two column items regardless of on where they are in the batch', () => {
const measurementStore = new MeasurementStore<{ ... }, number>();
const positionCache = new MeasurementStore<{ ... }, Position>();
const heightsCache = new HeightsStore();
Expand Down Expand Up @@ -351,6 +351,7 @@ describe('two column layout test cases', () => {
measurementStore.set(item, item.height);
});
layout(mockItems);
// third row, first column
expect(positionCache.get(mockItems[twoColumnModuleIndex])).toEqual({
height: 200,
left: 99,
Expand All @@ -373,10 +374,11 @@ describe('two column layout test cases', () => {
measurementStore.set(item, item.height);
});
layout(mockItems);
// item 5 so second row, second column
expect(positionCache.get(mockItems[twoColumnModuleIndex])).toEqual({
height: 200,
left: 99,
top: 0,
left: 353,
top: 214,
width: 494,
});
});
Expand Down

0 comments on commit d0ccf02

Please sign in to comment.