mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-03-22 12:33:11 -04:00
chore: minor code enhancements
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import React from 'react';
|
||||
import { render, fireEvent } from '@testing-library/react';
|
||||
|
||||
import { useItemListSync } from '../../../src/static/js/utils/hooks/useItemListSync';
|
||||
|
||||
let mockListHandler: any;
|
||||
let mockOnItemsLoad = jest.fn();
|
||||
let mockOnItemsCount = jest.fn();
|
||||
let addListItemsSpy = jest.fn();
|
||||
|
||||
jest.mock('../../../src/static/js/utils/settings/config', () => ({
|
||||
config: jest.fn(() => jest.requireActual('../../tests-constants').sampleMediaCMSConfig),
|
||||
}));
|
||||
@@ -16,11 +23,6 @@ jest.mock('../../../src/static/js/utils/helpers/', () => ({
|
||||
translateString: (s: string) => s,
|
||||
}));
|
||||
|
||||
let mockListHandler: any;
|
||||
let mockOnItemsLoad = jest.fn();
|
||||
let mockOnItemsCount = jest.fn();
|
||||
let addListItemsSpy = jest.fn();
|
||||
|
||||
// Mock useItemList to control items, counts, and listHandler
|
||||
jest.mock('../../../src/static/js/utils/hooks/useItemList', () => ({
|
||||
useItemList: (props: any, _ref: any) => {
|
||||
@@ -41,8 +43,6 @@ jest.mock('../../../src/static/js/utils/hooks/useItemList', () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
import { useItemListSync } from '../../../src/static/js/utils/hooks/useItemListSync';
|
||||
|
||||
function HookConsumer(props: any) {
|
||||
const tuple = useItemListSync(props);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user