mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-02 04:46:18 -05:00
Expanding FileBrowser button widths when page is wide enough.
This commit is contained in:
parent
7005cd0681
commit
2acdc2e16d
4 changed files with 51 additions and 7 deletions
|
|
@ -34,6 +34,7 @@ jest.mock('../hooks/customHooks', () => ({
|
|||
useWROLMode: jest.fn(() => false),
|
||||
useStatusFlag: jest.fn(() => false),
|
||||
useUploadFile: () => mockUseUploadFile,
|
||||
useElementWidth: jest.fn(() => [() => {}, 0]),
|
||||
}));
|
||||
|
||||
// Mock react-dropzone
|
||||
|
|
@ -45,7 +46,7 @@ jest.mock('react-dropzone', () => ({
|
|||
}));
|
||||
|
||||
// Import mocked hooks for manipulation
|
||||
import {useBrowseFiles, useWROLMode} from '../hooks/customHooks';
|
||||
import {useBrowseFiles, useElementWidth, useWROLMode} from '../hooks/customHooks';
|
||||
|
||||
// Create wrapper with all required contexts
|
||||
const AllContextsWrapper = ({children}) => {
|
||||
|
|
@ -91,6 +92,8 @@ describe('FileBrowser', () => {
|
|||
fetchFiles: jest.fn(),
|
||||
});
|
||||
useWROLMode.mockReturnValue(false);
|
||||
// [callbackRef, width]; width 0 keeps footer buttons icon-only in tests.
|
||||
useElementWidth.mockReturnValue([() => {}, 0]);
|
||||
});
|
||||
|
||||
describe('Directory Selection', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue