-
Notifications
You must be signed in to change notification settings - Fork 245
Fix claiming promocodes stopped working #1824
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
Conversation
The action of claiming stopped working after the vercel ai sdk upgrade to v5 due to not having the authProcedure as part of the action. For this reason, the input parameter of workspace was not found within the action, and the action failed. This PR fixes this
b5b7eec
}) | ||
}) | ||
|
||
it('should successfully claim a promocode', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in this case is more useful just don't mock the user and assert the call fails. It's all we want to test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example
latitude-llm/apps/web/src/actions/commits/createDraftWithContentAction.test.ts
Lines 48 to 60 in b5b7eec
describe('unauthorized', () => { | |
it('errors when the user is not authenticated', async () => { | |
const { serverError } = await createDraftWithContentAction({ | |
projectId: project.id, | |
title: 'New Draft', | |
description: 'Draft Description', | |
documentUuid: document.documentUuid, | |
content: 'New content', | |
}) | |
expect(serverError).toEqual('Unauthorized') | |
}) | |
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to kill two birds with one stone with my test, as it would fail if you used errorHandling. However, I do like adding smaller tests to test specific things. Added
The action of claiming stopped working after the vercel ai sdk upgrade to v5 due to not having the authProcedure as part of the action. For this reason, the input parameter of workspace was not found within the action, and the action failed. This PR fixes this