Skip to content

Commit

Permalink
UIIN-2371: Fixing tests due to changes in eact-virtualized-auto-sizer. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro-Melnyshyn authored and mkuklis committed Mar 28, 2023
1 parent 02b450d commit f5af844
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 23 deletions.
1 change: 1 addition & 0 deletions test/jest/__mock__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ import './InstancePlugin.mock';
import './quickMarc.mock';
import './stripesComponents.mock';
import './reactBeautifulDnd.mock';
import './react-virtualized-auto-sizer';
1 change: 1 addition & 0 deletions test/jest/__mock__/react-virtualized-auto-sizer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jest.mock('react-virtualized-auto-sizer', () => ({ children }) => children({ height: 500, width: 500 }));
8 changes: 0 additions & 8 deletions test/jest/helpers/Harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,17 @@ import { CalloutContext } from '@folio/stripes/core';

import translations from '../../../translations/ui-inventory/en';
import prefixKeys from './prefixKeys';
import mockOffsetSize from './mockOffsetSize';

const Harness = ({
children,
translations: translationsConfig,
shouldMockOffsetSize = true,
width = 500,
height = 500,
}) => {
const allTranslations = prefixKeys(translations);

translationsConfig.forEach(tx => {
Object.assign(allTranslations, prefixKeys(tx.translations, tx.prefix));
});

if (shouldMockOffsetSize) {
mockOffsetSize(width, height);
}

const defaultRichTextElements = ['b', 'i', 'em', 'strong', 'span', 'div', 'p', 'ul', 'ol', 'li', 'code'].reduce((res, Tag) => {
res[Tag] = chunks => <Tag>{chunks}</Tag>;

Expand Down
15 changes: 0 additions & 15 deletions test/jest/helpers/mockOffsetSize.js

This file was deleted.

0 comments on commit f5af844

Please sign in to comment.