yinji/docs/TOAST_TEST_CHECKLIST.md
wenpai 9587cd8ef4 feat: Sprint 1-3 安全修复、状态管理重构、性能优化
Sprint 1 - 安全基线修复(5项):
- 修复 DOM XSS 漏洞(seal-library.js, batch-processing.js)
- 修复 settings 导入 schema 注入
- CDN 锁版本 + SRI 完整性校验
- 外链添加 rel="noopener noreferrer"
- 替换 confirm/prompt 为自定义对话框

Sprint 2 - 状态管理重构(4项):
- 新建 state.js 单例模式管理全局状态
- 解耦 window.* 全局变量
- 修复印章库状态同步 bug
- localStorage 添加错误处理

Sprint 3 - 性能优化(4项):
- 删除死代码(loadScript, cleanupDistantCanvases 等)
- 实现缩略图懒加载(前3页+可视区)
- 添加文件大小限制(PDF 50MB / 图片 5MB)
- 完善 Canvas 内存清理

修复总计: 13项(3 P0 + 3 P1 + 6 P2 + 1 P3)

[CC] [CX]
2026-03-28 13:45:52 +08:00

102 lines
3.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Toast Notification System - Test Checklist
## Test Environment
- **Server**: http://localhost:8000
- **Test Page**: http://localhost:8000/test-toast.html
- **Main App**: http://localhost:8000/index.html
## Manual Test Cases
### 1. Basic Toast Display
- [ ] Success toast displays with green border and checkmark icon
- [ ] Error toast displays with red border and X icon
- [ ] Warning toast displays with yellow border and warning icon
- [ ] Info toast displays with blue border and info icon
### 2. Toast Animations
- [ ] Toast slides in from right smoothly
- [ ] Toast slides out to right when dismissed
- [ ] Animation duration is appropriate (~300ms)
### 3. Auto-Dismiss Functionality
- [ ] Success toast auto-dismisses after ~3 seconds
- [ ] Error toast auto-dismisses after ~5 seconds
- [ ] Warning toast auto-dismisses after ~3 seconds
- [ ] Info toast auto-dismisses after ~3 seconds
### 4. Manual Close
- [ ] Close button (×) is visible and clickable
- [ ] Clicking close button dismisses toast immediately
- [ ] Close button hover state works
### 5. Multiple Toasts
- [ ] Multiple toasts stack vertically
- [ ] Toasts maintain 10px gap between them
- [ ] New toasts appear at bottom of stack
- [ ] Dismissing one toast doesn't affect others
### 6. Long Messages
- [ ] Long messages wrap correctly
- [ ] Toast width adjusts appropriately (max 500px)
- [ ] Text remains readable
### 7. Integration with Main App
- [ ] PDF file validation errors show error toast
- [ ] PDF file too large shows error toast with size info
- [ ] Seal image validation errors show error toast
- [ ] Seal image loaded successfully shows success toast
- [ ] PDF loaded successfully shows success toast
- [ ] Add seal without seal image shows warning toast
- [ ] Add straddle seal without seal shows warning toast
- [ ] Delete seal without selection shows warning toast
- [ ] Export PDF success shows success toast
- [ ] Export PDF with no seals shows warning toast
### 8. Edge Cases
- [ ] Rapid clicking doesn't break toast system
- [ ] Clear all toasts works correctly
- [ ] Toast container is created only once
- [ ] No memory leaks after many toasts
## Test Results
### Test Page (test-toast.html)
**Date**: 2026-01-08
**Status**: ⏳ Pending manual testing
**Instructions**:
1. Open http://localhost:8000/test-toast.html
2. Click each button and verify the toast appears correctly
3. Test multiple toasts by clicking "Test Multiple Toasts"
4. Test long message display
5. Test manual close button
6. Test "Clear All Toasts" button
### Main Application (index.html)
**Date**: 2026-01-08
**Status**: ⏳ Pending manual testing
**Instructions**:
1. Open http://localhost:8000/index.html
2. Try uploading a PDF file > 50MB (should show error toast)
3. Try uploading a valid PDF (should show success toast)
4. Try uploading an image > 5MB as seal (should show error toast)
5. Try uploading a valid seal image (should show success toast)
6. Try adding seal without selecting seal image (should show warning toast)
7. Try deleting seal without selection (should show warning toast)
8. Try exporting PDF without seals (should show warning toast)
9. Complete full workflow and export PDF (should show success toast)
## Code Review Checklist
- [x] notifications.js loaded before main.js in index.html
- [x] All alert() calls replaced with Toast methods
- [x] Toast CSS styles added to style.css
- [x] Toast container positioned correctly (fixed, top-right)
- [x] Z-index high enough (10000) to appear above all content
- [x] No console errors in browser
## Notes
- Server started on port 8000
- Test page created for isolated testing
- All 12 alert() calls in main.js have been replaced
- Toast system uses window.Toast global object