Skip to content

Conversation

@chakrihacker
Copy link
Contributor

@chakrihacker chakrihacker commented Dec 19, 2025

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Remove any casting in test cases and add correct types

References

https://auth0.slack.com/archives/C09DNSP8U0Z/p1766047059411379

Testing

All Tests should pass

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@github-actions
Copy link

🚀 Preview deployment

Branch: refs/pull/40/merge
Commit: 82cc962

📝 Preview URL: https://auth0-universal-components-7g9p702ia-okta.vercel.app


Updated at 2025-12-19T05:47:20.494Z

Base automatically changed from refactor/fix-org-translations to feat/rename-org-in-react-package December 24, 2025 07:38
Base automatically changed from feat/rename-org-in-react-package to feat/rename-org-to-organization December 24, 2025 07:49
Base automatically changed from feat/rename-org-to-organization to main January 5, 2026 09:33
Comment on lines +19 to +20
const mockMyOrganizationClient = mockCoreClient.getMyOrganizationApiClient();
mockMyOrganizationClient.organization.configuration.get = mockGet;
Copy link
Contributor

Choose a reason for hiding this comment

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

Im not entirely sure this override is necessary, as we aren't providing a specific response during the mock phase. Could you please double check if this is required?

Comment on lines +84 to +102
const createCustomMockTranslator = (): ReturnType<
typeof useTranslatorModule.useTranslator
>['t'] => {
const translatorFn = vi.fn((key: string, params?: Record<string, unknown>) => {
if (key === 'general_error') return 'An error occurred';
if (key === 'update_success') return `Updated ${params?.providerName || ''}`;
if (key === 'delete_success') return `Deleted ${params?.providerName || ''}`;
if (key === 'remove_success')
return `Removed ${params?.providerName || ''} from ${params?.organizationName || ''}`;
return key;
});

// Add trans method for EnhancedTranslationFunction compatibility
const translator = Object.assign(translatorFn, {
trans: vi.fn(() => []),
});

return translator as ReturnType<typeof useTranslatorModule.useTranslator>['t'];
};
Copy link
Contributor

@rax7389 rax7389 Jan 6, 2026

Choose a reason for hiding this comment

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

can we try to use the existing mock translator test utility createMockI18nService?

@rax7389 rax7389 added the test contains only test cases label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test contains only test cases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants