LinkDesk/frontend/test-default-status-managem...

288 lines
13 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test: Default Status Management</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 1200px;
margin: 20px auto;
padding: 20px;
background: #f5f5f5;
}
.test-section {
background: white;
padding: 20px;
margin-bottom: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
h1 {
color: #333;
border-bottom: 2px solid #4CAF50;
padding-bottom: 10px;
}
h2 {
color: #555;
margin-top: 0;
}
.test-case {
margin: 15px 0;
padding: 15px;
background: #f9f9f9;
border-left: 4px solid #2196F3;
}
.test-case h3 {
margin-top: 0;
color: #2196F3;
}
.checklist {
list-style: none;
padding-left: 0;
}
.checklist li {
padding: 8px 0;
border-bottom: 1px solid #eee;
}
.checklist li:before {
content: "☐ ";
color: #999;
font-weight: bold;
margin-right: 8px;
}
.pass {
color: #4CAF50;
}
.fail {
color: #f44336;
}
code {
background: #f4f4f4;
padding: 2px 6px;
border-radius: 3px;
font-family: 'Courier New', monospace;
}
.note {
background: #fff3cd;
border-left: 4px solid #ffc107;
padding: 10px;
margin: 10px 0;
}
.success {
background: #d4edda;
border-left: 4px solid #28a745;
padding: 10px;
margin: 10px 0;
}
</style>
</head>
<body>
<h1>🧪 Default Status Management Test Plan</h1>
<div class="test-section">
<h2>📋 Test Overview</h2>
<p>This test plan validates the default status management functionality for custom task statuses.</p>
<p><strong>Requirements:</strong> 5.1, 5.2, 5.3, 5.4, 5.5</p>
</div>
<div class="test-section">
<h2>🔧 Setup Instructions</h2>
<ol>
<li>Ensure backend server is running: <code>cd backend && uvicorn main:app --reload</code></li>
<li>Ensure frontend server is running: <code>cd frontend && npm run dev</code></li>
<li>Login as a coordinator or admin user</li>
<li>Navigate to a project's settings page</li>
<li>Go to the "Tasks" tab to access Custom Task Status Manager</li>
</ol>
</div>
<div class="test-section">
<h2>✅ Test Cases</h2>
<div class="test-case">
<h3>Test 1: Visual Indicator for Default Status</h3>
<p><strong>Requirement:</strong> 5.1 - WHEN a user views the status list THEN the system SHALL indicate which status is the default</p>
<ul class="checklist">
<li>View the custom statuses list</li>
<li>Verify that the default status has a "Default" badge with a star icon</li>
<li>Verify that non-default statuses show "Custom" badge instead</li>
<li>Verify that system statuses show "System" badge</li>
</ul>
<div class="note">
<strong>Expected:</strong> Default status should be clearly marked with a distinctive badge containing a star icon.
</div>
</div>
<div class="test-case">
<h3>Test 2: Set Status as Default</h3>
<p><strong>Requirement:</strong> 5.2 - WHEN a user clicks "Set as Default" on a status THEN the system SHALL mark that status as the default and remove the default flag from other statuses</p>
<ul class="checklist">
<li>Create at least 2 custom statuses if not already present</li>
<li>Identify which status is currently the default</li>
<li>Click "Set as Default" button on a different status</li>
<li>Verify success toast message appears</li>
<li>Verify the clicked status now shows "Default" badge</li>
<li>Verify the previous default status now shows "Custom" badge</li>
<li>Verify only ONE status has the "Default" badge</li>
</ul>
<div class="note">
<strong>Expected:</strong> Only one status should be marked as default at any time. Setting a new default should automatically unset the previous default.
</div>
</div>
<div class="test-case">
<h3>Test 3: Set as Default Button Visibility</h3>
<p><strong>Requirement:</strong> UI should show "Set as Default" button only for non-default statuses</p>
<ul class="checklist">
<li>View the custom statuses list</li>
<li>Verify that non-default statuses have a "Set as Default" button</li>
<li>Verify that the default status does NOT have a "Set as Default" button</li>
<li>Set a different status as default</li>
<li>Verify the button visibility updates correctly</li>
</ul>
<div class="note">
<strong>Expected:</strong> The "Set as Default" button should only appear for statuses that are not currently the default.
</div>
</div>
<div class="test-case">
<h3>Test 4: Default Status for New Tasks</h3>
<p><strong>Requirement:</strong> 5.3 - WHEN a new task is created without an explicit status THEN the system SHALL assign the project's default status</p>
<ul class="checklist">
<li>Set a custom status as the default (e.g., "Ready to Start")</li>
<li>Navigate to a shot or asset in the project</li>
<li>Create a new task without specifying a status</li>
<li>Verify the task is created with the default custom status</li>
<li>Change the default status to a different one</li>
<li>Create another new task</li>
<li>Verify the new task uses the updated default status</li>
</ul>
<div class="note">
<strong>Expected:</strong> New tasks should automatically receive the project's default status when no status is explicitly specified.
</div>
</div>
<div class="test-case">
<h3>Test 5: Fallback to System Default</h3>
<p><strong>Requirement:</strong> 5.4 - WHEN no custom statuses exist THEN the system SHALL use "not_started" as the default status</p>
<ul class="checklist">
<li>Delete all custom statuses (if any exist)</li>
<li>Create a new task</li>
<li>Verify the task is created with "not_started" status</li>
<li>Create a custom status but don't set it as default</li>
<li>Create another new task</li>
<li>Verify the task still uses "not_started" as default</li>
</ul>
<div class="note">
<strong>Expected:</strong> When no custom default is set, the system should fall back to "not_started" as the default status.
</div>
</div>
<div class="test-case">
<h3>Test 6: Default Status Deletion Handling</h3>
<p><strong>Requirement:</strong> 5.5 - WHEN a default status is deleted THEN the system SHALL automatically assign the first status in the list as the new default</p>
<ul class="checklist">
<li>Create at least 2 custom statuses</li>
<li>Set one as the default</li>
<li>Delete the default status (with task reassignment if needed)</li>
<li>Verify the deletion succeeds</li>
<li>Verify another status is automatically marked as default</li>
<li>Create a new task to confirm the new default is applied</li>
</ul>
<div class="note">
<strong>Expected:</strong> Deleting the default status should automatically promote another status to be the new default.
</div>
</div>
<div class="test-case">
<h3>Test 7: Edit Dialog Default Checkbox</h3>
<p><strong>Requirement:</strong> Users should be able to set default status through the edit dialog</p>
<ul class="checklist">
<li>Click the edit button on a non-default status</li>
<li>Verify the "Set as default status for new tasks" checkbox is present</li>
<li>Verify the checkbox is unchecked</li>
<li>Check the checkbox and save</li>
<li>Verify the status is now marked as default</li>
<li>Edit the default status</li>
<li>Verify the checkbox is checked</li>
<li>Uncheck it and save</li>
<li>Verify the status is no longer default</li>
</ul>
<div class="note">
<strong>Expected:</strong> The edit dialog should allow toggling the default status via checkbox.
</div>
</div>
<div class="test-case">
<h3>Test 8: Concurrent Default Status Updates</h3>
<p><strong>Requirement:</strong> System should handle multiple users trying to set default status</p>
<ul class="checklist">
<li>Open the project settings in two different browser tabs/windows</li>
<li>In tab 1, set status A as default</li>
<li>In tab 2, set status B as default</li>
<li>Refresh both tabs</li>
<li>Verify only one status is marked as default</li>
<li>Verify the last update wins</li>
</ul>
<div class="note">
<strong>Expected:</strong> The system should maintain consistency even with concurrent updates.
</div>
</div>
<div class="test-case">
<h3>Test 9: Button Disabled States</h3>
<p><strong>Requirement:</strong> UI should prevent actions during operations</p>
<ul class="checklist">
<li>Click "Set as Default" on a status</li>
<li>Verify the button shows loading state or is disabled</li>
<li>Verify other "Set as Default" buttons are also disabled</li>
<li>Wait for the operation to complete</li>
<li>Verify buttons are re-enabled</li>
<li>Start a drag-and-drop reorder operation</li>
<li>Verify "Set as Default" buttons are disabled during reorder</li>
</ul>
<div class="note">
<strong>Expected:</strong> Buttons should be disabled during operations to prevent race conditions.
</div>
</div>
<div class="test-case">
<h3>Test 10: API Response Validation</h3>
<p><strong>Requirement:</strong> Backend should correctly handle default status updates</p>
<ul class="checklist">
<li>Open browser DevTools Network tab</li>
<li>Set a status as default</li>
<li>Verify PUT request to <code>/api/projects/{id}/task-statuses/{status_id}</code></li>
<li>Verify request body includes <code>is_default: true</code></li>
<li>Verify response includes updated statuses list</li>
<li>Verify only one status has <code>is_default: true</code> in response</li>
</ul>
<div class="note">
<strong>Expected:</strong> API should correctly update the default status and return consistent data.
</div>
</div>
</div>
<div class="test-section">
<h2>🐛 Known Issues / Edge Cases</h2>
<ul>
<li>What happens if all custom statuses are deleted? (Should fall back to system default)</li>
<li>Can system statuses be set as default? (No, only custom statuses)</li>
<li>What if the default status is in use by many tasks and gets deleted? (Should reassign and set new default)</li>
</ul>
</div>
<div class="test-section">
<h2>📊 Test Results</h2>
<p>Record your test results here:</p>
<textarea style="width: 100%; height: 200px; padding: 10px; font-family: monospace;" placeholder="Enter test results, observations, and any issues found..."></textarea>
</div>
<div class="success">
<strong>✅ All tests passed?</strong> If yes, mark task 15 as complete in the implementation plan!
</div>
</body>
</html>