feat: B4 - progressbar
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -263,6 +263,51 @@ class TasksApiGoldenTest(unittest.TestCase):
|
||||
self.assertEqual(body["status"], "ready")
|
||||
self.assertEqual(body["destination"], "docs.zip")
|
||||
|
||||
def test_get_task_detail_requested_archive_download(self) -> None:
|
||||
self._insert_task(
|
||||
task_id="task-download-requested",
|
||||
operation="download",
|
||||
status="requested",
|
||||
source="storage1/docs",
|
||||
destination="docs.zip",
|
||||
created_at="2026-03-10T10:00:00Z",
|
||||
done_items=0,
|
||||
total_items=1,
|
||||
)
|
||||
|
||||
response = self._get("/api/tasks/task-download-requested")
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
body = response.json()
|
||||
self.assertEqual(body["operation"], "download")
|
||||
self.assertEqual(body["status"], "requested")
|
||||
self.assertEqual(body["done_items"], 0)
|
||||
self.assertEqual(body["total_items"], 1)
|
||||
|
||||
def test_get_task_detail_preparing_archive_download_with_current_item(self) -> None:
|
||||
self._insert_task(
|
||||
task_id="task-download-preparing",
|
||||
operation="download",
|
||||
status="preparing",
|
||||
source="storage1/docs",
|
||||
destination="docs.zip",
|
||||
created_at="2026-03-10T10:00:00Z",
|
||||
started_at="2026-03-10T10:00:01Z",
|
||||
done_items=1,
|
||||
total_items=3,
|
||||
current_item="storage1/docs/b.txt",
|
||||
)
|
||||
|
||||
response = self._get("/api/tasks/task-download-preparing")
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
body = response.json()
|
||||
self.assertEqual(body["operation"], "download")
|
||||
self.assertEqual(body["status"], "preparing")
|
||||
self.assertEqual(body["done_items"], 1)
|
||||
self.assertEqual(body["total_items"], 3)
|
||||
self.assertEqual(body["current_item"], "storage1/docs/b.txt")
|
||||
|
||||
def test_get_task_detail_cancelled_archive_download(self) -> None:
|
||||
self._insert_task(
|
||||
task_id="task-download-cancelled",
|
||||
|
||||
@@ -229,6 +229,10 @@ class UiSmokeGoldenTest(unittest.TestCase):
|
||||
self.assertIn('function closeFeedbackModal()', app_js)
|
||||
self.assertIn('function downloadModalElements()', app_js)
|
||||
self.assertIn('function isZipDownloadSelection(items)', app_js)
|
||||
self.assertIn('function archiveTaskStatusLabel(status)', app_js)
|
||||
self.assertIn('function archiveTaskCountText(task)', app_js)
|
||||
self.assertIn('function archiveTaskCurrentItemText(task)', app_js)
|
||||
self.assertIn('function archiveTaskProgressPercent(task)', app_js)
|
||||
self.assertIn('function openZipDownloadModal(selectedItems)', app_js)
|
||||
self.assertIn('function markZipDownloadReady(fileName)', app_js)
|
||||
self.assertIn('function markZipDownloadFailed(err)', app_js)
|
||||
@@ -248,16 +252,18 @@ class UiSmokeGoldenTest(unittest.TestCase):
|
||||
self.assertIn('async function downloadFileRequest(paths)', app_js)
|
||||
self.assertIn('const zipDownload = isZipDownloadSelection(selectedItems);', app_js)
|
||||
self.assertIn('openZipDownloadModal(selectedItems);', app_js)
|
||||
self.assertIn('targetText: "Preparing download..."', app_js)
|
||||
self.assertIn('statusText: "Preparing download..."', app_js)
|
||||
self.assertIn('countText: "Preparing zip download"', app_js)
|
||||
self.assertIn('countText: "Zip preflight and packaging"', app_js)
|
||||
self.assertIn('statusText: "Download started"', app_js)
|
||||
self.assertIn('countText: "Browser download started"', app_js)
|
||||
self.assertIn('countText: "Zip download failed"', app_js)
|
||||
self.assertIn('countText: "Zip download cancelled"', app_js)
|
||||
self.assertIn('targetText: "Archive download requested"', app_js)
|
||||
self.assertIn('statusText: "Requested"', app_js)
|
||||
self.assertIn('countText: "Waiting for archive task"', app_js)
|
||||
self.assertIn('targetText: "Archive download task"', app_js)
|
||||
self.assertIn('statusText: "Ready"', app_js)
|
||||
self.assertIn('countText: "Browser download requested"', app_js)
|
||||
self.assertIn('countText: "Archive task failed"', app_js)
|
||||
self.assertIn('countText: "Archive task cancelled"', app_js)
|
||||
self.assertIn('statusText: "Cancelling download..."', app_js)
|
||||
self.assertIn('statusText: err.message || "Download failed"', app_js)
|
||||
self.assertIn('statusText: `Failed: ${err.message || "Archive download failed"}`', app_js)
|
||||
self.assertIn('return `${task.done_items}/${task.total_items} top-level items`;', app_js)
|
||||
self.assertIn('return `Current: ${task.current_item}`;', app_js)
|
||||
self.assertIn('downloadProgressState.requestKey === requestKey', app_js)
|
||||
self.assertIn('setStatus("Preparing download...");', app_js)
|
||||
self.assertIn('"/api/files/download/archive-prepare"', app_js)
|
||||
|
||||
Reference in New Issue
Block a user