chore: format
This commit is contained in:
@ -743,7 +743,7 @@ pub struct ImportJsonHeadless {
|
||||
impl Effect for ImportJsonHeadless {
|
||||
fn apply(&self, app: &mut App) {
|
||||
use crate::import::analyzer::{
|
||||
analyze_records, extract_array_at_path, find_array_paths, FieldKind,
|
||||
FieldKind, analyze_records, extract_array_at_path, find_array_paths,
|
||||
};
|
||||
use crate::import::wizard::ImportPipeline;
|
||||
|
||||
@ -952,8 +952,8 @@ pub fn help_page_set(page: usize) -> Box<dyn Effect> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::model::cell::{CellKey, CellValue};
|
||||
use crate::model::Model;
|
||||
use crate::model::cell::{CellKey, CellValue};
|
||||
|
||||
fn test_app() -> App {
|
||||
let mut m = Model::new("Test");
|
||||
@ -1036,12 +1036,13 @@ mod tests {
|
||||
fn add_formula_adds_target_item_to_category() {
|
||||
let mut app = test_app();
|
||||
// "Margin" does not exist as an item in "Type" before adding the formula
|
||||
assert!(!app
|
||||
.model
|
||||
.category("Type")
|
||||
.unwrap()
|
||||
.ordered_item_names()
|
||||
.contains(&"Margin"));
|
||||
assert!(
|
||||
!app.model
|
||||
.category("Type")
|
||||
.unwrap()
|
||||
.ordered_item_names()
|
||||
.contains(&"Margin")
|
||||
);
|
||||
AddFormula {
|
||||
raw: "Margin = Food * 2".to_string(),
|
||||
target_category: "Type".to_string(),
|
||||
@ -1257,16 +1258,14 @@ mod tests {
|
||||
#[test]
|
||||
fn set_buffer_empty_clears() {
|
||||
let mut app = test_app();
|
||||
app.buffers.insert("formula".to_string(), "old text".to_string());
|
||||
app.buffers
|
||||
.insert("formula".to_string(), "old text".to_string());
|
||||
SetBuffer {
|
||||
name: "formula".to_string(),
|
||||
value: String::new(),
|
||||
}
|
||||
.apply(&mut app);
|
||||
assert_eq!(
|
||||
app.buffers.get("formula").map(|s| s.as_str()),
|
||||
Some(""),
|
||||
);
|
||||
assert_eq!(app.buffers.get("formula").map(|s| s.as_str()), Some(""),);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1597,19 +1596,21 @@ 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