Преглед на файлове

test(e2e): 完成 Story 9.3 - 备注管理功能测试

实现备注管理的完整 E2E 测试覆盖,包含添加、编辑、删除功能。

测试覆盖 (8个测试全部通过):
- ✅ 添加简单备注
- ✅ 添加长文本备注
- ✅ 编辑备注
- ✅ 删除备注
- ✅ 添加多条备注
- ✅ 标记特殊需求
- ✅ 限制最多添加10条备注
- ✅ 完整流程测试

新增文件:
- web/tests/e2e/specs/admin/disability-person-note.spec.ts

修改文件:
- web/tests/e2e/pages/admin/disability-person.page.ts (添加7个备注管理方法)
- _bmad-output/implementation-artifacts/9-3-note-tests.md
- _bmad-output/implementation-artifacts/sprint-status.yaml

Generated with [Claude Code](https://claude.com/claude-code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname преди 1 седмица
родител
ревизия
e589d94b48

+ 57 - 27
_bmad-output/implementation-artifacts/9-3-note-tests.md

@@ -1,6 +1,6 @@
 # Story 9.3: 备注管理功能测试
 
-Status: ready-for-dev
+Status: review
 
 <!-- Note: Validation is optional. Run validate-create-story for quality check before dev-story. -->
 
@@ -31,29 +31,29 @@ Status: ready-for-dev
 
 ## Tasks / Subtasks
 
-- [ ] **Task 1: 分析备注管理功能的 DOM 结构** (AC: #1, #2, #3)
-  - [ ] Subtask 1.1: 在残疾人管理页面中定位备注管理区域
-  - [ ] Subtask 1.2: 分析添加备注按钮和表单结构
-  - [ ] Subtask 1.3: 分析备注列表展示结构
-  - [ ] Subtask 1.4: 分析编辑和删除按钮的选择器
-
-- [ ] **Task 2: 创建备注测试文件** (AC: #1, #2, #3)
-  - [ ] Subtask 2.1: 创建 `web/tests/e2e/specs/admin/disability-person-note.spec.ts`
-  - [ ] Subtask 2.2: 编写添加备注测试
-  - [ ] Subtask 2.3: 编写编辑备注测试
-  - [ ] Subtask 2.4: 编写删除备注测试
-
-- [ ] **Task 3: 更新 Page Object** (AC: #1, #2, #3)
-  - [ ] Subtask 3.1: 添加备注管理相关方法到 `DisabilityPersonManagementPage`
-  - [ ] Subtask 3.2: 实现 `addNote()` 方法
-  - [ ] Subtask 3.3: 实现 `editNote()` 方法
-  - [ ] Subtask 3.4: 实现 `deleteNote()` 方法
-  - [ ] Subtask 3.5: 实现 `getNoteList()` 方法用于验证
-
-- [ ] **Task 4: 运行测试并验证通过** (AC: #1, #2, #3)
-  - [ ] Subtask 4.1: 使用 `pnpm test:e2e:chromium disability-person-note` 运行测试
-  - [ ] Subtask 4.2: 修复发现的问题
-  - [ ] Subtask 4.3: 验证所有测试通过
+- [x] **Task 1: 分析备注管理功能的 DOM 结构** (AC: #1, #2, #3)
+  - [x] Subtask 1.1: 在残疾人管理页面中定位备注管理区域
+  - [x] Subtask 1.2: 分析添加备注按钮和表单结构
+  - [x] Subtask 1.3: 分析备注列表展示结构
+  - [x] Subtask 1.4: 分析编辑和删除按钮的选择器
+
+- [x] **Task 2: 创建备注测试文件** (AC: #1, #2, #3)
+  - [x] Subtask 2.1: 创建 `web/tests/e2e/specs/admin/disability-person-note.spec.ts`
+  - [x] Subtask 2.2: 编写添加备注测试
+  - [x] Subtask 2.3: 编写编辑备注测试
+  - [x] Subtask 2.4: 编写删除备注测试
+
+- [x] **Task 3: 更新 Page Object** (AC: #1, #2, #3)
+  - [x] Subtask 3.1: 添加备注管理相关方法到 `DisabilityPersonManagementPage`
+  - [x] Subtask 3.2: 实现 `addNote()` 方法
+  - [x] Subtask 3.3: 实现 `editNote()` 方法
+  - [x] Subtask 3.4: 实现 `deleteNote()` 方法
+  - [x] Subtask 3.5: 实现 `getNoteList()` 方法用于验证
+
+- [x] **Task 4: 运行测试并验证通过** (AC: #1, #2, #3)
+  - [x] Subtask 4.1: 使用 `pnpm test:e2e:chromium disability-person-note` 运行测试
+  - [x] Subtask 4.2: 修复发现的问题
+  - [x] Subtask 4.3: 验证所有测试通过
 
 ## Dev Notes
 
@@ -394,11 +394,41 @@ Claude Opus 4 (claude-opus-4-5-20251101)
    - TypeScript + Playwright 陷阱警告
    - 完整的参考文档列表
 
+5. ✅ **DOM 结构分析完成**:
+   - 备注管理组件使用内联表单(非对话框模式)
+   - 关键选择器:`add-remark-button`, `remove-remark-{index}`, `remark-content-textarea-{index}`, `special-needs-switch-{index}`
+   - 最多支持 10 条备注
+
+6. ✅ **测试文件创建完成**:`web/tests/e2e/specs/admin/disability-person-note.spec.ts`
+   - 实现了 8 个完整的测试用例
+   - 使用 `test.describe.serial` 顺序执行(数据隔离需要)
+   - 包含登录、测试执行、数据清理逻辑
+
+7. ✅ **所有 8 个测试通过** (100%):
+   - ✅ 应该成功添加简单备注
+   - ✅ 应该成功添加长文本备注
+   - ✅ 应该成功编辑备注
+   - ✅ 应该成功删除备注
+   - ✅ 应该支持添加多条备注
+   - ✅ 应该支持标记特殊需求
+   - ✅ 应该限制最多添加10条备注
+   - ✅ 完整流程:添加多条备注、编辑、删除
+
+8. ✅ **Page Object 扩展完成**:`web/tests/e2e/pages/admin/disability-person.page.ts`
+   - 添加了 `addNote()` 方法
+   - 添加了 `editNote()` 方法
+   - 添加了 `deleteNote()` 方法
+   - 添加了 `getNoteList()` 方法
+   - 添加了 `getNoteCount()` 方法
+   - 添加了 `getNoteSpecialNeedsStatus()` 方法
+   - 添加了 `isAddNoteButtonDisabled()` 方法
+
 ### File List
 
 **创建的文件:**
 - `_bmad-output/implementation-artifacts/9-3-note-tests.md` - 本 story 文档
+- `web/tests/e2e/specs/admin/disability-person-note.spec.ts` - 备注测试文件(305行,8个测试用例)
 
-**待创建的文件(由 dev-story 执行):**
-- `web/tests/e2e/specs/admin/disability-person-note.spec.ts` - 备注测试文件
-- `web/tests/e2e/pages/admin/disability-person.page.ts` - Page Object 扩展(添加备注管理方法)
+**修改的文件:**
+- `_bmad-output/implementation-artifacts/sprint-status.yaml` - 更新 Story 9.3 状态
+- `web/tests/e2e/pages/admin/disability-person.page.ts` - Page Object 扩展(添加备注管理方法,+105行

+ 2 - 2
_bmad-output/implementation-artifacts/sprint-status.yaml

@@ -131,7 +131,7 @@ development_status:
   epic-9: in-progress
   9-1-photo-upload-tests: done              # 照片上传功能完整测试(所有8个测试通过)
   9-2-bankcard-tests: done              # 银行卡管理功能测试(添加、编辑、删除)
-  9-3-note-tests: in-progress          # 备注管理功能测试(添加、修改、删除)
+  9-3-note-tests: review               # 备注管理功能测试(添加、修改、删除)
   9-4-visit-tests: backlog               # 回访记录管理测试(创建、查看、编辑)
   9-5-crud-tests: backlog                # 完整流程测试(新增、编辑、删除、查看)
   9-6-parallel-isolation: backlog        # 测试隔离与并行执行验证
@@ -148,7 +148,7 @@ development_status:
   epic-10: in-progress
   10-1-order-page-object: done                  # 创建订单管理 Page Object
   10-2-order-list-tests: done                  # 编写订单列表查看测试(代码审查完成,所有HIGH和MEDIUM问题已修复)
-  10-3-order-filter-tests: backlog         # 编写订单搜索和筛选测试
+  10-3-order-filter-tests: ready-for-dev   # 编写订单搜索和筛选测试
   10-4-order-create-tests: backlog         # 编写创建订单测试
   10-5-order-edit-tests: backlog           # 编写编辑订单测试
   10-6-order-delete-tests: backlog         # 编写删除订单测试

+ 105 - 0
web/tests/e2e/pages/admin/disability-person.page.ts

@@ -552,4 +552,109 @@ export class DisabilityPersonManagementPage {
     await cancelButton.click();
     await this.waitForDialogClosed();
   }
+
+  /**
+   * 添加备注(内联表单模式)
+   * @param content 备注内容
+   * @param options 选项
+   */
+  async addNote(content: string, options?: { isSpecialNeeds?: boolean }): Promise<number> {
+    // 点击"添加备注"按钮
+    const addButton = this.page.locator('[data-testid="add-remark-button"]');
+    await addButton.click();
+    await this.page.waitForTimeout(300);
+
+    // 获取当前备注数量
+    const noteCount = await this.getNoteCount();
+    const noteIndex = noteCount > 0 ? noteCount - 1 : 0;
+
+    // 填写备注内容
+    const textarea = this.page.locator(`[data-testid="remark-content-textarea-${noteIndex}"]`);
+    await textarea.fill(content);
+
+    // 标记特殊需求(如果需要)
+    if (options?.isSpecialNeeds) {
+      const switchControl = this.page.locator(`[data-testid="special-needs-switch-${noteIndex}"]`);
+      const isChecked = await switchControl.isChecked();
+      if (!isChecked) {
+        await switchControl.click();
+      }
+    }
+
+    console.debug(`  ✓ 添加备注: ${content.substring(0, 30)}...`);
+    return noteIndex;
+  }
+
+  /**
+   * 编辑指定索引的备注
+   * @param index 备注索引(从0开始)
+   * @param content 更新的备注内容
+   */
+  async editNote(index: number, content: string): Promise<void> {
+    console.debug(`  编辑备注 ${index}`);
+
+    const textarea = this.page.locator(`[data-testid="remark-content-textarea-${index}"]`);
+    await textarea.clear();
+    await textarea.fill(content);
+
+    console.debug(`  ✓ 备注 ${index} 编辑完成`);
+  }
+
+  /**
+   * 删除指定索引的备注
+   * @param index 备注索引(从0开始)
+   */
+  async deleteNote(index: number): Promise<void> {
+    console.debug(`  删除备注 ${index}`);
+
+    const removeButton = this.page.locator(`[data-testid="remove-remark-${index}"]`);
+    await removeButton.click();
+    await this.page.waitForTimeout(300);
+
+    console.debug(`  ✓ 备注 ${index} 已删除`);
+  }
+
+  /**
+   * 获取备注列表
+   * @returns 备注内容数组
+   */
+  async getNoteList(): Promise<string[]> {
+    const notes: string[] = [];
+    const noteCount = await this.page.locator('[data-testid^="remark-content-textarea-"]').count();
+
+    for (let i = 0; i < noteCount; i++) {
+      const textarea = this.page.locator(`[data-testid="remark-content-textarea-${i}"]`);
+      const content = await textarea.inputValue();
+      notes.push(content);
+    }
+
+    return notes;
+  }
+
+  /**
+   * 获取备注数量
+   * @returns 备注数量
+   */
+  async getNoteCount(): Promise<number> {
+    return await this.page.locator('[data-testid^="remark-content-textarea-"]').count();
+  }
+
+  /**
+   * 获取指定备注的特殊需求状态
+   * @param index 备注索引(从0开始)
+   * @returns 是否标记为特殊需求
+   */
+  async getNoteSpecialNeedsStatus(index: number): Promise<boolean> {
+    const switchControl = this.page.locator(`[data-testid="special-needs-switch-${index}"]`);
+    return await switchControl.isChecked();
+  }
+
+  /**
+   * 检查添加备注按钮是否被禁用
+   * @returns 是否禁用
+   */
+  async isAddNoteButtonDisabled(): Promise<boolean> {
+    const addButton = this.page.locator('[data-testid="add-remark-button"]');
+    return await addButton.isDisabled();
+  }
 }

+ 304 - 0
web/tests/e2e/specs/admin/disability-person-note.spec.ts

@@ -0,0 +1,304 @@
+import { test, expect } from '../../utils/test-setup';
+import { readFileSync } from 'fs';
+import { join, dirname } from 'path';
+import { fileURLToPath } from 'url';
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = dirname(__filename);
+const testUsers = JSON.parse(readFileSync(join(__dirname, '../../fixtures/test-users.json'), 'utf-8'));
+
+// 超时配置
+const TIMEOUTS = {
+  SHORT: 300,
+  MEDIUM: 500,
+  LONG: 1000,
+} as const;
+
+// 用于跟踪已创建的测试数据,便于清理
+const createdTestData: Array<{ name: string; idCard: string }> = [];
+
+/**
+ * 生成唯一的测试数据
+ */
+function generateUniqueTestData(suffix: string) {
+  const randomPart = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
+  const timestamp = Date.now();
+  return {
+    name: `备注${suffix}_${timestamp}_${randomPart}`,
+    gender: randomPart % 2 === 0 ? '男' : '女',
+    idCard: `42010119900101${String(randomPart % 10000).padStart(4, '0')}`,
+    disabilityId: `511001199001${String(randomPart % 10000).padStart(4, '0')}`,
+    disabilityType: ['视力残疾', '听力残疾', '言语残疾', '肢体残疾', '智力残疾', '精神残疾'][randomPart % 6],
+    disabilityLevel: ['一级', '二级', '三级', '四级'][randomPart % 4],
+    phone: `138${String(randomPart % 100000000).padStart(8, '0')}`,
+    idAddress: `湖北省武汉市测试街道${randomPart % 100}号`,
+    province: '湖北省',
+    city: '武汉市'
+  };
+}
+
+test.describe.serial('残疾人管理 - 备注管理功能', () => {
+  test.beforeEach(async ({ adminLoginPage, disabilityPersonPage }) => {
+    // 以管理员身份登录后台
+    await adminLoginPage.goto();
+    await adminLoginPage.login(testUsers.admin.username, testUsers.admin.password);
+    await adminLoginPage.expectLoginSuccess();
+    await disabilityPersonPage.goto();
+  });
+
+  test.afterEach(async ({ disabilityPersonPage, page }) => {
+    // 清理测试数据
+    for (const data of createdTestData) {
+      try {
+        await disabilityPersonPage.goto();
+        await disabilityPersonPage.searchByName(data.name);
+        const deleteButton = page.getByRole('button', { name: '删除' }).first();
+        if (await deleteButton.count() > 0) {
+          await deleteButton.click();
+          await page.getByRole('button', { name: '确认' }).click().catch(() => {});
+          await page.waitForTimeout(TIMEOUTS.MEDIUM);
+        }
+      } catch (error) {
+        console.debug(`  ⚠ 清理数据失败: ${data.name}`, error);
+      }
+    }
+    createdTestData.length = 0;
+  });
+
+  test('应该成功添加简单备注', async ({ disabilityPersonPage }) => {
+    const testData = generateUniqueTestData('简单备注');
+    createdTestData.push({ name: testData.name, idCard: testData.idCard });
+
+    console.log('\n========== 添加简单备注测试 ==========');
+
+    // 打开对话框并填写基本信息
+    await disabilityPersonPage.openCreateDialog();
+    await disabilityPersonPage.fillBasicForm(testData);
+
+    // 滚动到备注管理区域
+    await disabilityPersonPage.scrollToSection('备注管理');
+
+    // 添加备注
+    const noteContent = `这是一条测试备注_${testData.name}`;
+    await disabilityPersonPage.addNote(noteContent);
+
+    // 验证备注出现在列表中
+    const noteList = await disabilityPersonPage.getNoteList();
+    expect(noteList).toHaveLength(1);
+    expect(noteList[0]).toContain(noteContent);
+    console.debug('  ✓ 备注已添加');
+
+    console.log('✅ 添加简单备注测试通过');
+  });
+
+  test('应该成功添加长文本备注', async ({ disabilityPersonPage }) => {
+    const testData = generateUniqueTestData('长文本备注');
+    createdTestData.push({ name: testData.name, idCard: testData.idCard });
+
+    console.log('\n========== 添加长文本备注测试 ==========');
+
+    // 打开对话框并填写基本信息
+    await disabilityPersonPage.openCreateDialog();
+    await disabilityPersonPage.fillBasicForm(testData);
+
+    // 滚动到备注管理区域
+    await disabilityPersonPage.scrollToSection('备注管理');
+
+    // 添加长文本备注
+    const longNote = `这是一条很长的备注内容_${testData.name}`.repeat(10);
+    await disabilityPersonPage.addNote(longNote);
+
+    // 验证备注出现在列表中
+    const noteList = await disabilityPersonPage.getNoteList();
+    expect(noteList).toHaveLength(1);
+    expect(noteList[0]).toContain('这是一条很长的备注内容');
+    console.debug('  ✓ 长文本备注已添加');
+
+    console.log('✅ 添加长文本备注测试通过');
+  });
+
+  test('应该成功编辑备注', async ({ disabilityPersonPage }) => {
+    const testData = generateUniqueTestData('编辑备注');
+    createdTestData.push({ name: testData.name, idCard: testData.idCard });
+
+    console.log('\n========== 编辑备注测试 ==========');
+
+    // 打开对话框并填写基本信息
+    await disabilityPersonPage.openCreateDialog();
+    await disabilityPersonPage.fillBasicForm(testData);
+
+    // 滚动到备注管理区域
+    await disabilityPersonPage.scrollToSection('备注管理');
+
+    // 添加原始备注
+    const originalNote = `原始备注_${testData.name}`;
+    await disabilityPersonPage.addNote(originalNote);
+
+    // 编辑备注
+    const updatedNote = `更新后的备注_${testData.name}`;
+    await disabilityPersonPage.editNote(0, updatedNote);
+
+    // 验证更新后的内容
+    const noteList = await disabilityPersonPage.getNoteList();
+    expect(noteList[0]).toContain(updatedNote);
+    expect(noteList[0]).not.toContain(originalNote);
+    console.debug('  ✓ 备注已编辑');
+
+    console.log('✅ 编辑备注测试通过');
+  });
+
+  test('应该成功删除备注', async ({ disabilityPersonPage }) => {
+    const testData = generateUniqueTestData('删除备注');
+    createdTestData.push({ name: testData.name, idCard: testData.idCard });
+
+    console.log('\n========== 删除备注测试 ==========');
+
+    // 打开对话框并填写基本信息
+    await disabilityPersonPage.openCreateDialog();
+    await disabilityPersonPage.fillBasicForm(testData);
+
+    // 滚动到备注管理区域
+    await disabilityPersonPage.scrollToSection('备注管理');
+
+    // 添加备注
+    const noteContent = `待删除备注_${testData.name}`;
+    await disabilityPersonPage.addNote(noteContent);
+
+    // 验证备注存在
+    let noteList = await disabilityPersonPage.getNoteList();
+    expect(noteList).toHaveLength(1);
+    console.debug('  ✓ 备注已添加');
+
+    // 删除备注
+    await disabilityPersonPage.deleteNote(0);
+
+    // 验证备注已被删除
+    noteList = await disabilityPersonPage.getNoteList();
+    expect(noteList).toHaveLength(0);
+    console.debug('  ✓ 备注已删除');
+
+    console.log('✅ 删除备注测试通过');
+  });
+
+  test('应该支持添加多条备注', async ({ disabilityPersonPage }) => {
+    const testData = generateUniqueTestData('多条备注');
+    createdTestData.push({ name: testData.name, idCard: testData.idCard });
+
+    console.log('\n========== 添加多条备注测试 ==========');
+
+    // 打开对话框并填写基本信息
+    await disabilityPersonPage.openCreateDialog();
+    await disabilityPersonPage.fillBasicForm(testData);
+
+    // 滚动到备注管理区域
+    await disabilityPersonPage.scrollToSection('备注管理');
+
+    // 添加多条备注
+    await disabilityPersonPage.addNote(`备注1_${testData.name}`);
+    await disabilityPersonPage.addNote(`备注2_${testData.name}`);
+    await disabilityPersonPage.addNote(`备注3_${testData.name}`);
+
+    // 验证所有备注都显示
+    const noteList = await disabilityPersonPage.getNoteList();
+    expect(noteList).toHaveLength(3);
+    console.debug('  ✓ 已添加 3 条备注');
+
+    console.log('✅ 添加多条备注测试通过');
+  });
+
+  test('应该支持标记特殊需求', async ({ disabilityPersonPage }) => {
+    const testData = generateUniqueTestData('特殊需求');
+    createdTestData.push({ name: testData.name, idCard: testData.idCard });
+
+    console.log('\n========== 特殊需求标记测试 ==========');
+
+    // 打开对话框并填写基本信息
+    await disabilityPersonPage.openCreateDialog();
+    await disabilityPersonPage.fillBasicForm(testData);
+
+    // 滚动到备注管理区域
+    await disabilityPersonPage.scrollToSection('备注管理');
+
+    // 添加带特殊需求标记的备注
+    const noteContent = `特殊需求备注_${testData.name}`;
+    await disabilityPersonPage.addNote(noteContent, { isSpecialNeeds: true });
+
+    // 验证特殊需求开关状态
+    const isSpecialNeeds = await disabilityPersonPage.getNoteSpecialNeedsStatus(0);
+    expect(isSpecialNeeds).toBe(true);
+    console.debug('  ✓ 特殊需求已标记');
+
+    console.log('✅ 特殊需求标记测试通过');
+  });
+
+  test('应该限制最多添加10条备注', async ({ disabilityPersonPage }) => {
+    const testData = generateUniqueTestData('备注限制');
+    createdTestData.push({ name: testData.name, idCard: testData.idCard });
+
+    console.log('\n========== 备注数量限制测试 ==========');
+
+    // 打开对话框并填写基本信息
+    await disabilityPersonPage.openCreateDialog();
+    await disabilityPersonPage.fillBasicForm(testData);
+
+    // 滚动到备注管理区域
+    await disabilityPersonPage.scrollToSection('备注管理');
+
+    // 添加10条备注
+    for (let i = 0; i < 10; i++) {
+      await disabilityPersonPage.addNote(`备注${i + 1}_${testData.name}`);
+    }
+
+    // 验证有10条备注
+    const noteList = await disabilityPersonPage.getNoteList();
+    expect(noteList).toHaveLength(10);
+    console.debug('  ✓ 已添加 10 条备注');
+
+    // 验证添加按钮被禁用
+    const isDisabled = await disabilityPersonPage.isAddNoteButtonDisabled();
+    expect(isDisabled).toBe(true);
+    console.debug('  ✓ 添加按钮已禁用(达到最大数量)');
+
+    console.log('✅ 备注数量限制测试通过');
+  });
+
+  test('完整流程:添加多条备注、编辑、删除', async ({ disabilityPersonPage }) => {
+    const testData = generateUniqueTestData('完整流程');
+    createdTestData.push({ name: testData.name, idCard: testData.idCard });
+
+    console.log('\n========== 备注完整流程测试 ==========');
+
+    // 打开对话框并填写基本信息
+    await disabilityPersonPage.openCreateDialog();
+    await disabilityPersonPage.fillBasicForm(testData);
+
+    // 滚动到备注管理区域
+    await disabilityPersonPage.scrollToSection('备注管理');
+
+    // 添加多条备注
+    await disabilityPersonPage.addNote(`第一条备注_${testData.name}`, { isSpecialNeeds: true });
+    await disabilityPersonPage.addNote(`第二条备注_${testData.name}`);
+    await disabilityPersonPage.addNote(`第三条备注_${testData.name}`);
+
+    let noteList = await disabilityPersonPage.getNoteList();
+    expect(noteList).toHaveLength(3);
+    console.debug('  ✓ 已添加 3 条备注');
+
+    // 编辑第一条备注
+    await disabilityPersonPage.editNote(0, `编辑后的第一条备注_${testData.name}`);
+    console.debug('  ✓ 第一条备注已编辑');
+
+    // 删除第二条备注
+    await disabilityPersonPage.deleteNote(1);
+    console.debug('  ✓ 第二条备注已删除');
+
+    // 验证最终状态
+    noteList = await disabilityPersonPage.getNoteList();
+    expect(noteList).toHaveLength(2);
+    expect(noteList[0]).toContain('编辑后的第一条备注');
+    expect(noteList[1]).toContain('第三条备注');
+    console.debug('  ✓ 最终状态验证通过');
+
+    console.log('✅ 备注完整流程测试通过');
+  });
+});