mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
ML: Hide bulk actions if not assets or folders exist
This commit is contained in:
parent
06694ec71d
commit
d67128ed9f
@ -161,7 +161,7 @@ export const MediaLibrary = () => {
|
||||
<ActionLayout
|
||||
startActions={
|
||||
<>
|
||||
{canUpdate && (
|
||||
{canUpdate && (assetCount > 0 || folderCount > 0) && (
|
||||
<BoxWithHeight
|
||||
paddingLeft={2}
|
||||
paddingRight={2}
|
||||
|
@ -210,6 +210,24 @@ describe('Media library homepage', () => {
|
||||
});
|
||||
|
||||
describe('select all', () => {
|
||||
it('is not visible if there are not folders and assets', () => {
|
||||
useAssets.mockReturnValueOnce({
|
||||
isLoading: false,
|
||||
error: null,
|
||||
data: {},
|
||||
});
|
||||
useFolders.mockReturnValueOnce({
|
||||
data: [],
|
||||
isLoading: false,
|
||||
error: null,
|
||||
});
|
||||
renderML();
|
||||
|
||||
expect(
|
||||
screen.queryByText('There are no elements with the applied filters')
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows the select all button when the user is allowed to update', () => {
|
||||
renderML();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user