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
@@ -238,12 +238,11 @@ describe('HAFoldersEngine', () => {
expect(await engine.expandFolder(createHASS(), query)).toBeNull();
});
it('should early exit when limit is reached', async () => {
it('should return every matching media item without a cap', async () => {
const query: FolderQuery = {
source: QuerySource.Folder,
folder: { type: 'ha', id: 'test' },
path: [{ ha: { id: 'media-source://id' } }],
limit: 1,
};
vi.mocked(homeAssistantWSRequest).mockResolvedValueOnce(
@@ -266,8 +265,7 @@ describe('HAFoldersEngine', () => {
const engine = new HAFoldersEngine(templateManager);
const results = await engine.expandFolder(createHASS(), query);
// Even though there are 2 children, the limit of 1 should trigger earlyExit.
expect(results?.length).toBe(1);
expect(results?.length).toBe(2);
});
// See additional matcher testing in media-matcher.test.ts .