Refactor ESLint configuration and update test rules for clarity and consistency
- Consolidated and modularized `eslint.config.mjs` with defined rules for source, test, E2E, and scripts. - Improved test and E2E rules with relaxed settings for flexibility and enhanced mocking. - Standardized variable naming and removed redundant imports in unit and E2E tests. - Updated error handling and comments to align with modern TypeScript best practices (e.g., `@ts-expect-error`).
This commit is contained in:
@@ -510,8 +510,6 @@ describe('UserActionMenu', () => {
|
||||
|
||||
describe('User Name Display', () => {
|
||||
it('displays full name when last name is provided', async () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<UserActionMenu
|
||||
user={mockUser}
|
||||
@@ -527,7 +525,6 @@ describe('UserActionMenu', () => {
|
||||
});
|
||||
|
||||
it('displays first name only when last name is null', async () => {
|
||||
const user = userEvent.setup();
|
||||
const userWithoutLastName = { ...mockUser, last_name: null };
|
||||
|
||||
render(
|
||||
|
||||
@@ -52,9 +52,9 @@ describe('UserFormDialog', () => {
|
||||
|
||||
describe('Module Exports', () => {
|
||||
it('exports UserFormDialog component', () => {
|
||||
const module = require('@/components/admin/users/UserFormDialog');
|
||||
expect(module.UserFormDialog).toBeDefined();
|
||||
expect(typeof module.UserFormDialog).toBe('function');
|
||||
const moduleExports = require('@/components/admin/users/UserFormDialog');
|
||||
expect(moduleExports.UserFormDialog).toBeDefined();
|
||||
expect(typeof moduleExports.UserFormDialog).toBe('function');
|
||||
});
|
||||
|
||||
it('component is a valid React component', () => {
|
||||
|
||||
Reference in New Issue
Block a user