Skip to content

Conversation

learningbizz
Copy link
Contributor

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

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
andresgutgon
andresgutgon previously approved these changes Oct 16, 2025
geclos
geclos previously approved these changes Oct 16, 2025
@learningbizz learningbizz dismissed stale reviews from geclos and andresgutgon via b5b7eec October 17, 2025 07:51
})
})

it('should successfully claim a promocode', async () => {
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

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

example

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')
})
})

Copy link
Contributor Author

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

@learningbizz learningbizz merged commit e52748b into main Oct 17, 2025
7 checks passed
@learningbizz learningbizz deleted the fix/promocodes-stopped-working branch October 17, 2025 09:05
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants