mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-24 18:56:59 -06:00
Integration: cargo fmt
This commit is contained in:
@@ -1183,14 +1183,7 @@ fn a_table_filter_criteria_survive_a_round_trip() {
|
||||
range: rr("A1:A4"),
|
||||
header_row: true,
|
||||
totals_row: false,
|
||||
columns: vec![TableColumn {
|
||||
name: "Region".into(),
|
||||
totals: TotalsFn::None,
|
||||
totals_label: None,
|
||||
formula: None,
|
||||
unique_name: None,
|
||||
xml: None,
|
||||
}],
|
||||
columns: vec![TableColumn { name: "Region".into(), totals: TotalsFn::None, totals_label: None, formula: None, unique_name: None, xml: None }],
|
||||
style: "TableStyleMedium2".into(),
|
||||
banded_rows: true,
|
||||
banded_cols: false,
|
||||
@@ -1203,10 +1196,8 @@ fn a_table_filter_criteria_survive_a_round_trip() {
|
||||
});
|
||||
// The dropdown of a table's header cell installs the sheet AutoFilter over the table's
|
||||
// range, and `data.filterBy` stores its criteria there.
|
||||
s.autofilter = Some(AutoFilter {
|
||||
range: rr("A1:A4"),
|
||||
criteria: vec![(0, FilterCriterion::Values { values: vec!["East".into()], blanks: false })],
|
||||
});
|
||||
s.autofilter =
|
||||
Some(AutoFilter { range: rr("A1:A4"), criteria: vec![(0, FilterCriterion::Values { values: vec!["East".into()], blanks: false })] });
|
||||
s.rows.entry(1).or_default().hidden = true;
|
||||
|
||||
let (back, rep) = read_xlsx(&write_xlsx(&wb).unwrap()).unwrap();
|
||||
@@ -1214,11 +1205,7 @@ fn a_table_filter_criteria_survive_a_round_trip() {
|
||||
let b = back.sheet(0).unwrap();
|
||||
let t = b.tables.first().expect("the table survived");
|
||||
let (_, crit) = t.filter.first().expect("the table's filter criteria were kept on save");
|
||||
assert!(
|
||||
matches!(crit, FilterCriterion::Values { values, .. } if values == &["East".to_string()]),
|
||||
"the criteria were dropped: {:?}",
|
||||
t.filter
|
||||
);
|
||||
assert!(matches!(crit, FilterCriterion::Values { values, .. } if values == &["East".to_string()]), "the criteria were dropped: {:?}", t.filter);
|
||||
assert!(b.is_row_hidden(1), "the row the filter hid is still hidden");
|
||||
assert!(b.autofilter.is_none(), "a table's filter belongs to the table part, not the sheet");
|
||||
}
|
||||
@@ -1233,14 +1220,8 @@ fn a_partial_sheet_filter_is_not_folded_into_a_table() {
|
||||
for (a, v) in [("A1", "Id"), ("B1", "Region"), ("A2", "1"), ("B2", "East"), ("A3", "2"), ("B3", "West")] {
|
||||
s.set_value(at(a), Value::text(v));
|
||||
}
|
||||
let column = |name: &str| TableColumn {
|
||||
name: name.into(),
|
||||
totals: TotalsFn::None,
|
||||
totals_label: None,
|
||||
formula: None,
|
||||
unique_name: None,
|
||||
xml: None,
|
||||
};
|
||||
let column =
|
||||
|name: &str| TableColumn { name: name.into(), totals: TotalsFn::None, totals_label: None, formula: None, unique_name: None, xml: None };
|
||||
s.tables.push(Table {
|
||||
id: 1,
|
||||
name: "Sales".into(),
|
||||
@@ -1258,10 +1239,8 @@ fn a_partial_sheet_filter_is_not_folded_into_a_table() {
|
||||
table_type: None,
|
||||
connection_id: None,
|
||||
});
|
||||
s.autofilter = Some(AutoFilter {
|
||||
range: rr("B1:B3"),
|
||||
criteria: vec![(0, FilterCriterion::Values { values: vec!["East".into()], blanks: false })],
|
||||
});
|
||||
s.autofilter =
|
||||
Some(AutoFilter { range: rr("B1:B3"), criteria: vec![(0, FilterCriterion::Values { values: vec!["East".into()], blanks: false })] });
|
||||
|
||||
let (back, rep) = read_xlsx(&write_xlsx(&wb).unwrap()).unwrap();
|
||||
assert!(rep.warnings.is_empty(), "{:?}", rep.warnings);
|
||||
|
||||
Reference in New Issue
Block a user