diff --git a/crates/app-iced/src/components/navigation/drawer/tests.rs b/crates/app-iced/src/components/navigation/drawer/tests.rs index 466d0c8..4044b28 100644 --- a/crates/app-iced/src/components/navigation/drawer/tests.rs +++ b/crates/app-iced/src/components/navigation/drawer/tests.rs @@ -43,11 +43,18 @@ fn rail_selected_label_is_secondary() { let drawer = palette(&ui, BASE, NavLayout::Drawer, Interaction::Enabled, true); assert_eq!(rail.label, ui.color(Role::Secondary)); assert_ne!(rail.label, drawer.label, "两条线的选中标签角色不同"); - // 但图标与药丸相同(同一套语言) - assert_eq!(rail.icon, drawer.icon); + // 图标与药丸相同(同一套语言)。 + // + // 复审 P2-1:这里原先写成 `pill_color(..) == pill_color(..)`——比的是同一个表达式,恒真, + // 抓不到任何东西(注释却还在说「两条线的药丸一致」)。药丸从 M257 起**不吃 layout** + // (`pill_color` 的签名里根本没有 `NavLayout`),所以「两条线一致」由**签名**保证; + // 本用例改判真正要守的那件事:静息选中药丸就是 `SecondaryContainer` 这一档 + // (换成 `Primary` 立刻红,变异原文见 M257 r2 报告)。 + assert_eq!(rail.icon, drawer.icon, "图标与布局无关"); assert_eq!( pill_color(&ui, BASE, Interaction::Enabled, true), - pill_color(&ui, BASE, Interaction::Enabled, true) + Some(ui.color(Role::SecondaryContainer)), + "两条线的静息选中药丸都必须来自 SecondaryContainer" ); }