chore: fmt + clippy
This commit is contained in:
@ -1123,15 +1123,35 @@ mod tests {
|
||||
#[test]
|
||||
fn transpose_axes_effect() {
|
||||
let mut app = test_app();
|
||||
let row_before: Vec<String> = app.model.active_view().categories_on(Axis::Row)
|
||||
.into_iter().map(String::from).collect();
|
||||
let col_before: Vec<String> = app.model.active_view().categories_on(Axis::Column)
|
||||
.into_iter().map(String::from).collect();
|
||||
let row_before: Vec<String> = app
|
||||
.model
|
||||
.active_view()
|
||||
.categories_on(Axis::Row)
|
||||
.into_iter()
|
||||
.map(String::from)
|
||||
.collect();
|
||||
let col_before: Vec<String> = app
|
||||
.model
|
||||
.active_view()
|
||||
.categories_on(Axis::Column)
|
||||
.into_iter()
|
||||
.map(String::from)
|
||||
.collect();
|
||||
TransposeAxes.apply(&mut app);
|
||||
let row_after: Vec<String> = app.model.active_view().categories_on(Axis::Row)
|
||||
.into_iter().map(String::from).collect();
|
||||
let col_after: Vec<String> = app.model.active_view().categories_on(Axis::Column)
|
||||
.into_iter().map(String::from).collect();
|
||||
let row_after: Vec<String> = app
|
||||
.model
|
||||
.active_view()
|
||||
.categories_on(Axis::Row)
|
||||
.into_iter()
|
||||
.map(String::from)
|
||||
.collect();
|
||||
let col_after: Vec<String> = app
|
||||
.model
|
||||
.active_view()
|
||||
.categories_on(Axis::Column)
|
||||
.into_iter()
|
||||
.map(String::from)
|
||||
.collect();
|
||||
assert_eq!(row_before, col_after);
|
||||
assert_eq!(col_before, row_after);
|
||||
}
|
||||
@ -1313,8 +1333,7 @@ mod tests {
|
||||
("Month".into(), "Jan".into()),
|
||||
]);
|
||||
// Set original cell
|
||||
app.model
|
||||
.set_cell(key.clone(), CellValue::Number(42.0));
|
||||
app.model.set_cell(key.clone(), CellValue::Number(42.0));
|
||||
|
||||
let records = vec![(key.clone(), CellValue::Number(42.0))];
|
||||
StartDrill(records).apply(&mut app);
|
||||
@ -1340,8 +1359,7 @@ mod tests {
|
||||
("Type".into(), "Food".into()),
|
||||
("Month".into(), "Jan".into()),
|
||||
]);
|
||||
app.model
|
||||
.set_cell(key.clone(), CellValue::Number(42.0));
|
||||
app.model.set_cell(key.clone(), CellValue::Number(42.0));
|
||||
|
||||
let records = vec![(key.clone(), CellValue::Number(42.0))];
|
||||
StartDrill(records).apply(&mut app);
|
||||
@ -1363,10 +1381,7 @@ mod tests {
|
||||
("Type".into(), "Drink".into()),
|
||||
("Month".into(), "Jan".into()),
|
||||
]);
|
||||
assert_eq!(
|
||||
app.model.get_cell(&new_key),
|
||||
Some(&CellValue::Number(42.0))
|
||||
);
|
||||
assert_eq!(app.model.get_cell(&new_key), Some(&CellValue::Number(42.0)));
|
||||
// "Drink" should have been added as an item
|
||||
let items: Vec<&str> = app
|
||||
.model
|
||||
@ -1385,8 +1400,7 @@ mod tests {
|
||||
("Type".into(), "Food".into()),
|
||||
("Month".into(), "Jan".into()),
|
||||
]);
|
||||
app.model
|
||||
.set_cell(key.clone(), CellValue::Number(42.0));
|
||||
app.model.set_cell(key.clone(), CellValue::Number(42.0));
|
||||
|
||||
let records = vec![(key.clone(), CellValue::Number(42.0))];
|
||||
StartDrill(records).apply(&mut app);
|
||||
@ -1465,10 +1479,7 @@ mod tests {
|
||||
item: "Food".to_string(),
|
||||
}
|
||||
.apply(&mut app);
|
||||
assert_eq!(
|
||||
app.model.active_view().page_selection("Type"),
|
||||
Some("Food")
|
||||
);
|
||||
assert_eq!(app.model.active_view().page_selection("Type"), Some("Food"));
|
||||
}
|
||||
|
||||
// ── Hide/show items ─────────────────────────────────────────────────
|
||||
@ -1501,21 +1512,19 @@ mod tests {
|
||||
group: "MyGroup".to_string(),
|
||||
}
|
||||
.apply(&mut app);
|
||||
assert!(
|
||||
app.model
|
||||
.active_view()
|
||||
.is_group_collapsed("Type", "MyGroup")
|
||||
);
|
||||
assert!(app
|
||||
.model
|
||||
.active_view()
|
||||
.is_group_collapsed("Type", "MyGroup"));
|
||||
ToggleGroup {
|
||||
category: "Type".to_string(),
|
||||
group: "MyGroup".to_string(),
|
||||
}
|
||||
.apply(&mut app);
|
||||
assert!(
|
||||
!app.model
|
||||
.active_view()
|
||||
.is_group_collapsed("Type", "MyGroup")
|
||||
);
|
||||
assert!(!app
|
||||
.model
|
||||
.active_view()
|
||||
.is_group_collapsed("Type", "MyGroup"));
|
||||
}
|
||||
|
||||
// ── Cycle axis ──────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user