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(test): Set limit on first page #160

Merged
merged 2 commits into from
Dec 18, 2024
Merged
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
6 changes: 6 additions & 0 deletions vitest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ class NangoActionMock {
const paginateInBody = ['post', 'put', 'patch'].includes(args.method.toLowerCase());
const updatedBodyOrParams = paginateInBody ? (args.data as Record<string, any>) || {} : args.params || {};

if (args.paginate['limit']) {
const limitParameterName = args.paginate.limit_name_in_request!;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ! came up because Front doesn't have the limit parameter configured limit_name_in_request. I was surprised those tests failed but traced it back to here. Here's updatedBodyOrParams printing in Front's tests:

stdout | integrations/front/tests/front-conversation.test.ts > front conversation tests > should output the action output that is expected
{ undefined: 100 }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed in #161


updatedBodyOrParams[limitParameterName] = args.paginate['limit'];
}

if (args.paginate?.type === 'cursor') {
yield* this.cursorPaginate(args, updatedBodyOrParams, paginateInBody);
} else if (args.paginate?.type === 'link') {
Expand Down
Loading