Refactor user management and logs viewing tests for improved stability and clarity
- Scoped button selectors to dialogs in user management tests to avoid strict mode violations. - Added wait conditions for loading states and element visibility in user management and logs viewing tests. - Updated navigation methods to use 'domcontentloaded' for better reliability. - Enhanced mock data generation for log entries and improved filtering logic in logs viewing tests. - Consolidated selector usage with data-testid attributes for consistency and maintainability. - Removed skipped tests and ensured all scenarios are covered for logs viewing, including pagination and filtering.
This commit is contained in:
@@ -64,11 +64,14 @@ export const LogTable: React.FC<LogTableProps> = ({ logs, isLoading }) => {
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm">
|
||||
{log.status > 0 && (
|
||||
<span className={`px-2 inline-flex text-xs leading-5 font-semibold rounded-full
|
||||
<span
|
||||
className={`px-2 inline-flex text-xs leading-5 font-semibold rounded-full
|
||||
${log.status >= 500 ? 'bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200' :
|
||||
log.status >= 400 ? 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200' :
|
||||
log.status >= 300 ? 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200' :
|
||||
'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200'}`}>
|
||||
'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200'}`}
|
||||
data-testid={`status-${log.status}`}
|
||||
>
|
||||
{log.status}
|
||||
</span>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user