first commit
This commit is contained in:
commit
b54624be96
226 files changed
+108840
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import AccountAdminShell from '../AccountAdminShell.tsx';
|
||||
|
||||
vi.mock('../../context/AuthContext.tsx', () => ({
|
||||
useAuth: () => ({
|
||||
user: {
|
||||
id: 9,
|
||||
user_name: 'account_admin',
|
||||
status: 'account_admin',
|
||||
is_superuser: false,
|
||||
created_at: '',
|
||||
updated_at: '',
|
||||
},
|
||||
logout: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('../UserManagementPage.tsx', () => ({
|
||||
default: () => <div>User management content</div>,
|
||||
}));
|
||||
|
||||
describe('AccountAdminShell', () => {
|
||||
it('shows only User Management nav, not ops dashboards', () => {
|
||||
render(<AccountAdminShell />);
|
||||
expect(screen.getByText('Manajemen Akun')).toBeInTheDocument();
|
||||
expect(screen.getByText('User management content')).toBeInTheDocument();
|
||||
expect(screen.queryByText('Dashboard')).not.toBeInTheDocument();
|
||||
expect(screen.queryByText('Hitung Ayam')).not.toBeInTheDocument();
|
||||
expect(screen.queryByText('FCR')).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user