Skip to content

Commit ade2cd5

Browse files
authored
Merge pull request #202 from emmertex/fix/mcp-undo-test
Fix MCP undo test after the oldest-first default sort
2 parents 7f8cc7a + 164a5c5 commit ade2cd5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎crates/mcp/src/tests.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,15 @@ fn import_tool_moves_with_a_folder_template() {
279279
fn command_tools_run_commands() {
280280
let mut b = Headless::demo();
281281
let first = b.session.visible_cloned()[0];
282+
let before = b.session.catalog.photo(first).unwrap().rating;
282283
let r = call_tool(&mut b, "cmd_library_select", &json!({"ids": [first.0]}));
283284
assert!(!r.is_error, "{r:?}");
284285
let r = call_tool(&mut b, "cmd_photo_rate", &json!({"rating": 4}));
285286
assert!(!r.is_error, "{r:?}");
286287
assert_eq!(b.session.catalog.photo(first).unwrap().rating, 4);
287288
let r = call_tool(&mut b, "cmd_edit_undo", &json!({}));
288289
assert!(!r.is_error);
289-
assert_eq!(b.session.catalog.photo(first).unwrap().rating, 0);
290+
assert_eq!(b.session.catalog.photo(first).unwrap().rating, before, "undo restores the rating");
290291
}
291292

292293
#[test]

0 commit comments

Comments
 (0)