mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-26 11:46:49 -06:00
Build the saved UiState in the test with struct update syntax (clippy field_reassign_with_default)
This commit is contained in:
@@ -75,9 +75,7 @@ fn leaving_the_table_while_on_table_design_returns_to_home() {
|
||||
|
||||
#[test]
|
||||
fn startup_opens_on_home_not_the_saved_tab() {
|
||||
let mut saved = gridcraft_ui_egui::UiState::default();
|
||||
saved.ribbon_tab = "Table Design".into();
|
||||
saved.dark = true;
|
||||
let saved = gridcraft_ui_egui::UiState { ribbon_tab: "Table Design".into(), dark: true, ..Default::default() };
|
||||
let json = serde_json::to_string(&saved).unwrap();
|
||||
assert!(json.contains(r#""ribbonTab":"Table Design""#), "{json}");
|
||||
let restored = serde_json::from_str::<gridcraft_ui_egui::UiState>(&json).unwrap().at_startup();
|
||||
|
||||
Reference in New Issue
Block a user