fix(engine): settings sync section scrollable + flaky midnight test
Add 96px bottom padding to SettingsPanelScrollable so the Sync section is fully reachable by scrolling on Android (was clipped at container edge). Fix check_system_fires_warning_event_only_once_per_day flakiness: Bevy 0.18 Messages<T> keeps events visible for two frames, so tests running near UTC midnight saw a stale WarningToastEvent from headless_app()'s initial update. Clear the buffer with .clear() before each assertion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -581,6 +581,12 @@ mod tests {
|
|||||||
app.world_mut()
|
app.world_mut()
|
||||||
.resource_mut::<DailyExpiryWarningShown>()
|
.resource_mut::<DailyExpiryWarningShown>()
|
||||||
.0 = Some(today);
|
.0 = Some(today);
|
||||||
|
// Flush any stale events from headless_app()'s initial update (the
|
||||||
|
// double-buffer keeps them visible for one extra frame).
|
||||||
|
app.update();
|
||||||
|
app.world_mut()
|
||||||
|
.resource_mut::<Messages<WarningToastEvent>>()
|
||||||
|
.clear();
|
||||||
app.update();
|
app.update();
|
||||||
let events = app.world().resource::<Messages<WarningToastEvent>>();
|
let events = app.world().resource::<Messages<WarningToastEvent>>();
|
||||||
let mut cursor = events.get_cursor();
|
let mut cursor = events.get_cursor();
|
||||||
@@ -597,6 +603,9 @@ mod tests {
|
|||||||
.resource_mut::<ProgressResource>()
|
.resource_mut::<ProgressResource>()
|
||||||
.0
|
.0
|
||||||
.daily_challenge_last_completed = Some(today);
|
.daily_challenge_last_completed = Some(today);
|
||||||
|
app.world_mut()
|
||||||
|
.resource_mut::<Messages<WarningToastEvent>>()
|
||||||
|
.clear();
|
||||||
app.update();
|
app.update();
|
||||||
let events = app.world().resource::<Messages<WarningToastEvent>>();
|
let events = app.world().resource::<Messages<WarningToastEvent>>();
|
||||||
let mut cursor = events.get_cursor();
|
let mut cursor = events.get_cursor();
|
||||||
|
|||||||
@@ -1481,6 +1481,7 @@ fn spawn_settings_panel(
|
|||||||
row_gap: VAL_SPACE_3,
|
row_gap: VAL_SPACE_3,
|
||||||
max_height: Val::Vh(60.0),
|
max_height: Val::Vh(60.0),
|
||||||
overflow: Overflow::scroll_y(),
|
overflow: Overflow::scroll_y(),
|
||||||
|
padding: UiRect::bottom(Val::Px(96.0)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
|
|||||||
Reference in New Issue
Block a user