fix: Remove the unnecessary item limit from folder media (#2688)

- Fixed: #2573
This commit is contained in:
Dermot Duffy
2026-08-17 21:49:11 -07:00
committed by GitHub
parent 858c5d0610
commit 84b90bcc7e
12 changed files with 41 additions and 146 deletions
-54
View File
@@ -157,35 +157,6 @@ describe('navigateUp', () => {
path: [{ ha: { id: 'one' } }, { ha: { id: 'two' } }],
});
});
it('should go up in the folder hierarchy with limit', () => {
const api = createCardAPI();
const folder = createFolder();
const view = createView({
query: createFolderQuery(folder, [{ ha: { id: 'one' } }, { ha: { id: 'two' } }]),
});
vi.mocked(api.getViewManager().getView).mockReturnValue(view);
const epoch: ViewManagerEpoch = {
manager: api.getViewManager(),
};
const builder = new UnifiedQueryBuilder(
mock<CameraManager>(),
mock<FoldersManager>(),
);
const options: FolderNavigationParamaters = {
builder,
viewManagerEpoch: epoch,
limit: 50,
};
navigateUp(options);
const query = vi.mocked(api.getViewManager().setViewByParametersWithExistingQuery)
.mock.calls[0][0]?.params?.query as UnifiedQuery;
expect(query.getNodes()[0].limit).toBe(50);
});
});
describe('navigateToFolder', () => {
@@ -241,31 +212,6 @@ describe('navigateToFolder', () => {
expect(nodes?.[0]).toHaveProperty('path');
expect((nodes?.[0] as { path: readonly unknown[] }).path).toHaveLength(2);
});
it('should navigate into folder with limit', () => {
const api = createCardAPI();
const folder = createFolder();
const epoch: ViewManagerEpoch = {
manager: api.getViewManager(),
};
const builder = new UnifiedQueryBuilder(
mock<CameraManager>(),
mock<FoldersManager>(),
);
const options: FolderNavigationParamaters = {
builder,
viewManagerEpoch: epoch,
limit: 100,
};
const item = new ViewFolder(folder, [{ ha: { id: 'root' } }]);
navigateToFolder(item, options);
const query = vi.mocked(api.getViewManager().setViewByParametersWithExistingQuery)
.mock.calls[0][0]?.params?.query;
expect(query?.getNodes()[0].limit).toBe(100);
});
});
describe('getUpFolderItem', () => {