Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update node subscriber feed params typings #3376

Merged
merged 1 commit into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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