Skip to content

Commit

Permalink
Merge pull request #3376 from shanehandley-lived/client-feed-typings
Browse files Browse the repository at this point in the history
fix: Update node subscriber feed params typings
  • Loading branch information
Pablo Fernández authored May 10, 2023
2 parents 14ec614 + e6c66bc commit 1811193
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/node/src/lib/subscribers/subscriber.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ export interface IUpdateSubscriberPreferencePayload {
}
export interface IGetSubscriberNotificationFeedParams {
page?: number;
feedIdentifier: string;
feedIdentifier?: string;
seen?: boolean;
}
15 changes: 15 additions & 0 deletions packages/node/src/lib/subscribers/subscribers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,21 @@ describe('test use of novus node package - Subscribers class', () => {
test('should get notification feed for subscriber correctly', async () => {
mockedAxios.get.mockResolvedValue({});

await novu.subscribers.getNotificationsFeed(
'test-news-feed-subscriber',
{}
);

expect(mockedAxios.get).toHaveBeenCalled();
expect(mockedAxios.get).toHaveBeenCalledWith(
'/subscribers/test-news-feed-subscriber/notifications/feed',
{ params: {} }
);
});

test('should get notification feed for subscriber with optional feedIdentifier', async () => {
mockedAxios.get.mockResolvedValue({});

await novu.subscribers.getNotificationsFeed('test-news-feed-subscriber', {
feedIdentifier: '123',
});
Expand Down

0 comments on commit 1811193

Please sign in to comment.