Skip to content

test: add tests for team_users and correct list_team_users_by count#3283

Open
laraujo7 wants to merge 1 commit intoLogflare:mainfrom
laraujo7:la/team_users-tests
Open

test: add tests for team_users and correct list_team_users_by count#3283
laraujo7 wants to merge 1 commit intoLogflare:mainfrom
laraujo7:la/team_users-tests

Conversation

@laraujo7
Copy link
Contributor

No description provided.

@laraujo7 laraujo7 force-pushed the la/team_users-tests branch from 866419d to 39d4075 Compare March 12, 2026 18:04
Copy link
Contributor

@Ziinc Ziinc left a comment

Choose a reason for hiding this comment

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

Nice catch


true ->
count = list_team_users_by(id: team_id) |> Enum.count()
count = list_team_users_by(team_id: team_id) |> Enum.count()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should cover this bugfix with a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeap, will do so 💪

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, the condition count < limit always evaluates to true because count is always 0, so a new team_user is always created. I’ve added a test to verify the behavior when the team has already reached the limit, so I believe this case is now covered. Let me know if you think we should handle it differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants