Skip to content

Commit

Permalink
fix: add missing limit in tag query
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyTseng committed Oct 20, 2024
1 parent 02dac1f commit 7172f42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,16 @@ describe('EventRepositorySqlite', () => {

describe('filter by generic tags', () => {
it('should filter by tags', async () => {
const result = await eventRepository.find({
const result1 = await eventRepository.find({
'#t': ['test'],
});
expect(result).toEqual([LONG_FORM_CONTENT_EVENT, TEXT_NOTE_EVENT]);
expect(result1).toEqual([LONG_FORM_CONTENT_EVENT, TEXT_NOTE_EVENT]);

const result2 = await eventRepository.find({
'#t': ['test'],
limit: 1,
});
expect(result2).toEqual([LONG_FORM_CONTENT_EVENT]);
});

it('should filter by multiple tags', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export class EventRepositorySqlite extends EventRepository {
'e.sig',
'e.created_at',
])
.limit(limit)
.execute();
return rows.map(this.toEvent);
}
Expand Down

0 comments on commit 7172f42

Please sign in to comment.