FIX: When creating a new sheet, select it

Fixes #100
This commit is contained in:
Nicolás Hatcher
2024-10-24 00:11:32 +02:00
committed by Nicolás Hatcher Andrés
parent 3d951c5c50
commit 80273a88ec
6 changed files with 26 additions and 16 deletions

View File

@@ -65,13 +65,13 @@ fn set_the_range_does_not_set_the_cell() {
fn add_new_sheet_and_back() {
let model = new_empty_model();
let mut model = UserModel::from_model(model);
model.new_sheet();
assert_eq!(model.get_selected_sheet(), 0);
model.new_sheet().unwrap();
assert_eq!(model.get_selected_sheet(), 1);
model.set_selected_cell(5, 4).unwrap();
model.set_selected_sheet(1).unwrap();
assert_eq!(model.get_selected_cell(), (1, 1, 1));
model.set_selected_sheet(0).unwrap();
assert_eq!(model.get_selected_cell(), (0, 5, 4));
assert_eq!(model.get_selected_cell(), (0, 1, 1));
model.set_selected_sheet(1).unwrap();
assert_eq!(model.get_selected_cell(), (1, 5, 4));
}
#[test]