Files
Document_Translator/test_store_fix.html
beabigegg b11a8272c4 2ND
2025-09-02 13:11:48 +08:00

39 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Store Test</title>
</head>
<body>
<h1>Store Test Page</h1>
<div id="test-output"></div>
<script>
// 模擬測試 jobsStore 的 subscribeToJobUpdates 方法
const mockJobsStore = {
subscribeToJobUpdates: function(jobUuid) {
console.log(`[TEST] subscribeToJobUpdates called with: ${jobUuid}`)
return true
}
}
// 測試方法是否存在
const testOutput = document.getElementById('test-output')
if (typeof mockJobsStore.subscribeToJobUpdates === 'function') {
testOutput.innerHTML = '<p style="color: green;">✅ subscribeToJobUpdates 方法存在且為函數</p>'
// 測試調用
try {
mockJobsStore.subscribeToJobUpdates('test-uuid-123')
testOutput.innerHTML += '<p style="color: green;">✅ 方法調用成功</p>'
} catch (error) {
testOutput.innerHTML += `<p style="color: red;">❌ 方法調用失敗: ${error.message}</p>`
}
} else {
testOutput.innerHTML = '<p style="color: red;">❌ subscribeToJobUpdates 不是一個函數</p>'
}
console.log('[TEST] Store test completed')
</script>
</body>
</html>