Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
test: fix failing test due to new way of
Browse files Browse the repository at this point in the history
  measuring height
  • Loading branch information
johanlahti committed Sep 12, 2023
1 parent 841e981 commit 53f9170
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@ import { IStore } from '../../../store';
import { IListboxResource } from '../../../hooks/types';
import { RenderTrackerService } from '../../../services/render-tracker';
import * as distResourcesMod from '../distribute-resources';
import { COLLAPSED_HEIGHT, ITEM_SPACING } from '../grid-constants';

describe('use-handle-resize', () => {
beforeAll(() => {
jest.spyOn(distResourcesMod, 'calculateExpandPriority').mockReturnValue({ columns: [{}, {}, {}], expandedItemsCount: 3 });
});

it('should return a resize handler which, upon call, returns columns and overflowingResources, calculated by other funcs', async () => {
const resources = [{
layout: {},
}] as unknown as IListboxResource[];
const resources = [{ layout: {} }, { layout: {} }, { layout: {} }] as unknown as IListboxResource[];

const MIN_HEIGHT_TO_FIT_3_LISTBOXES = 3 * COLLAPSED_HEIGHT + 2 * ITEM_SPACING + 2;

const gridRef = {
current: {},
current: {
offsetWidth: 0,
offsetHeight: MIN_HEIGHT_TO_FIT_3_LISTBOXES,
},
} as unknown as MutableRefObject<HTMLObjectElement>;

const store = {
Expand Down

0 comments on commit 53f9170

Please sign in to comment.