🧪 ci: Update PermissionService tests for PromptGroup resource type

- Refactor tests to use PromptGroup roles instead of Project roles.
- Initialize models and seed default roles in test setup.
- Update error handling for non-existent resource types.
- Ensure proper cleanup of test data while retaining seeded roles.
This commit is contained in:
Danny Avila 2025-08-02 15:23:58 -04:00
parent fc8fd489d6
commit 90b037a67f
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
5 changed files with 66 additions and 99 deletions

View file

@ -4,12 +4,10 @@ import userEvent from '@testing-library/user-event';
import '@testing-library/jest-dom';
import SearchBar from '../SearchBar';
// Mock useLocalize hook
jest.mock('~/hooks/useLocalize', () => () => (key: string) => key);
// Mock useDebounce hook
// Mock hooks
jest.mock('~/hooks', () => ({
useDebounce: (value: string) => value, // Return value immediately for testing
useLocalize: () => (key: string) => key,
}));
describe('SearchBar', () => {