Skip to content

Commit cd19159

Browse files
committed
feat(filter): avoid further enrichment if user not visible
Signed-off-by: Adam Setch <[email protected]>
1 parent 21a6b7c commit cd19159

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/renderer/utils/subject.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,30 @@ describe('renderer/utils/subject.ts', () => {
12551255

12561256
expect(result).toEqual(null);
12571257
});
1258+
1259+
it('early return if pull request user filtered', async () => {
1260+
nock('https://api.github.com')
1261+
.get('/repos/gitify-app/notifications-test/pulls/1')
1262+
.reply(200, {
1263+
number: 123,
1264+
state: 'open',
1265+
draft: false,
1266+
merged: false,
1267+
user: mockAuthor,
1268+
labels: [],
1269+
});
1270+
1271+
nock('https://api.github.com')
1272+
.get('/repos/gitify-app/notifications-test/issues/comments/302888448')
1273+
.reply(200, { user: mockCommenter });
1274+
1275+
const result = await getGitifySubjectDetails(mockNotification, {
1276+
...mockSettings,
1277+
filterUserTypes: ['Bot'],
1278+
});
1279+
1280+
expect(result).toEqual(null);
1281+
});
12581282
});
12591283

12601284
describe('Releases', () => {

0 commit comments

Comments
 (0)