core: the store tests pass clippy and rustfmt, so they reach the test step
CI & Build / Build now, or wait for Android? (push) Canceled after 0s
CI & Build / TypeScript typecheck (push) Canceled after 0s
CI & Build / Python lint (push) Canceled after 0s
CI & Build / Python tests (push) Canceled after 0s
CI & Build / integration (push) Canceled after 0s
CI & Build / Build & push image (push) Canceled after 0s
Android / Build, or is the channel already serving this? (push) Successful in 3s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
Desktop (Tauri) / Tauri desktop (Linux) (push) Failing after 3m48s
Desktop (Tauri) / Update manifest (push) Canceled after 0s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Canceled after 3m55s
Android / Kotlin + Rust (APK) (push) Canceled after 4m29s
CI & Build / Build now, or wait for Android? (push) Canceled after 0s
CI & Build / TypeScript typecheck (push) Canceled after 0s
CI & Build / Python lint (push) Canceled after 0s
CI & Build / Python tests (push) Canceled after 0s
CI & Build / integration (push) Canceled after 0s
CI & Build / Build & push image (push) Canceled after 0s
Android / Build, or is the channel already serving this? (push) Successful in 3s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
Desktop (Tauri) / Tauri desktop (Linux) (push) Failing after 3m48s
Desktop (Tauri) / Update manifest (push) Canceled after 0s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Canceled after 3m55s
Android / Kotlin + Rust (APK) (push) Canceled after 4m29s
7bc8e04 never got as far as running them: clippy's cloned_ref_to_slice_refs
rejected four `&[x.clone()]` slices, and the file wasn't rustfmt-formatted.
Still tests only — the expected RED is the two timestamp tests and the
text-search tests, ahead of the fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+94
-25
@@ -1083,7 +1083,11 @@ mod tests {
|
||||
.into_iter()
|
||||
.map(|t| t.title)
|
||||
.collect();
|
||||
assert_eq!(names, vec!["milk".to_string()], "trash has no place in the palette");
|
||||
assert_eq!(
|
||||
names,
|
||||
vec!["milk".to_string()],
|
||||
"trash has no place in the palette"
|
||||
);
|
||||
}
|
||||
|
||||
// ---- the board query -------------------------------------------------------
|
||||
@@ -1102,9 +1106,27 @@ mod tests {
|
||||
// The facets bind positionally, so a text facet that binds the wrong number
|
||||
// of values shifts every bound after it — this pairs it with one.
|
||||
let conn = db();
|
||||
stamped(&conn, "old", "milk", "2026-01-01T00:00:00.000Z", "2026-01-01T00:00:00.000Z");
|
||||
stamped(&conn, "new", "milk", "2026-07-01T00:00:00.000Z", "2026-07-01T00:00:00.000Z");
|
||||
stamped(&conn, "other", "eggs", "2026-07-01T00:00:00.000Z", "2026-07-01T00:00:00.000Z");
|
||||
stamped(
|
||||
&conn,
|
||||
"old",
|
||||
"milk",
|
||||
"2026-01-01T00:00:00.000Z",
|
||||
"2026-01-01T00:00:00.000Z",
|
||||
);
|
||||
stamped(
|
||||
&conn,
|
||||
"new",
|
||||
"milk",
|
||||
"2026-07-01T00:00:00.000Z",
|
||||
"2026-07-01T00:00:00.000Z",
|
||||
);
|
||||
stamped(
|
||||
&conn,
|
||||
"other",
|
||||
"eggs",
|
||||
"2026-07-01T00:00:00.000Z",
|
||||
"2026-07-01T00:00:00.000Z",
|
||||
);
|
||||
let found = list(
|
||||
&conn,
|
||||
json!({"view": "notes", "facets": {"q": "milk", "created_after": "2026-06-01T00:00:00.000Z"}}),
|
||||
@@ -1129,7 +1151,7 @@ mod tests {
|
||||
let both = note(&conn, "both");
|
||||
let one = note(&conn, "one");
|
||||
set_labels(&conn, &both.id, &[home.id.clone(), work.id.clone()]).expect("labels");
|
||||
set_labels(&conn, &one.id, &[home.id.clone()]).expect("labels");
|
||||
set_labels(&conn, &one.id, std::slice::from_ref(&home.id)).expect("labels");
|
||||
|
||||
let found = list(
|
||||
&conn,
|
||||
@@ -1144,17 +1166,27 @@ mod tests {
|
||||
let reminded = note(&conn, "reminded");
|
||||
let attached = note(&conn, "attached");
|
||||
note(&conn, "plain");
|
||||
update_note(&conn, &reminded.id, &json!({"remind_at": "2026-12-01T09:00:00.000Z"}))
|
||||
.expect("remind");
|
||||
update_note(
|
||||
&conn,
|
||||
&reminded.id,
|
||||
&json!({"remind_at": "2026-12-01T09:00:00.000Z"}),
|
||||
)
|
||||
.expect("remind");
|
||||
conn.execute(
|
||||
"INSERT INTO attachments (id, note_id, url) VALUES ('a', ?1, '/x')",
|
||||
[&attached.id],
|
||||
)
|
||||
.expect("attach");
|
||||
|
||||
let r = list(&conn, json!({"view": "notes", "facets": {"has_reminder": true}}));
|
||||
let r = list(
|
||||
&conn,
|
||||
json!({"view": "notes", "facets": {"has_reminder": true}}),
|
||||
);
|
||||
assert_eq!(ids(&r), vec![reminded.id.as_str()]);
|
||||
let a = list(&conn, json!({"view": "notes", "facets": {"has_attachment": true}}));
|
||||
let a = list(
|
||||
&conn,
|
||||
json!({"view": "notes", "facets": {"has_attachment": true}}),
|
||||
);
|
||||
assert_eq!(ids(&a), vec![attached.id.as_str()]);
|
||||
}
|
||||
|
||||
@@ -1167,12 +1199,18 @@ mod tests {
|
||||
update_note(&conn, &archived.id, &json!({"archived": true})).expect("archive");
|
||||
trash(&conn, &trashed.id).expect("trash");
|
||||
|
||||
assert_eq!(ids(&list(&conn, json!({"view": "notes"}))), vec![kept.id.as_str()]);
|
||||
assert_eq!(
|
||||
ids(&list(&conn, json!({"view": "notes"}))),
|
||||
vec![kept.id.as_str()]
|
||||
);
|
||||
assert_eq!(
|
||||
ids(&list(&conn, json!({"view": "archived"}))),
|
||||
vec![archived.id.as_str()]
|
||||
);
|
||||
assert_eq!(ids(&list(&conn, json!({"view": "trash"}))), vec![trashed.id.as_str()]);
|
||||
assert_eq!(
|
||||
ids(&list(&conn, json!({"view": "trash"}))),
|
||||
vec![trashed.id.as_str()]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1196,8 +1234,20 @@ mod tests {
|
||||
#[test]
|
||||
fn sort_created_orders_by_birth_not_by_edit() {
|
||||
let conn = db();
|
||||
stamped(&conn, "older", "a", "2026-01-01T00:00:00.000Z", "2026-09-01T00:00:00.000Z");
|
||||
stamped(&conn, "newer", "b", "2026-05-01T00:00:00.000Z", "2026-05-01T00:00:00.000Z");
|
||||
stamped(
|
||||
&conn,
|
||||
"older",
|
||||
"a",
|
||||
"2026-01-01T00:00:00.000Z",
|
||||
"2026-09-01T00:00:00.000Z",
|
||||
);
|
||||
stamped(
|
||||
&conn,
|
||||
"newer",
|
||||
"b",
|
||||
"2026-05-01T00:00:00.000Z",
|
||||
"2026-05-01T00:00:00.000Z",
|
||||
);
|
||||
let found = list(&conn, json!({"view": "notes", "sort": "created"}));
|
||||
assert_eq!(ids(&found), vec!["newer", "older"]);
|
||||
}
|
||||
@@ -1223,7 +1273,10 @@ mod tests {
|
||||
assert_eq!(n.body, "milk");
|
||||
assert_eq!(n.labels.len(), 1);
|
||||
assert_eq!(n.labels[0].name, "groceries");
|
||||
assert!(!n.labels[0].via_tag, "nothing in the body backs it any more");
|
||||
assert!(
|
||||
!n.labels[0].via_tag,
|
||||
"nothing in the body backs it any more"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1315,8 +1368,12 @@ mod tests {
|
||||
fn completing_a_one_off_reminder_clears_it() {
|
||||
let conn = db();
|
||||
let n = note(&conn, "once");
|
||||
update_note(&conn, &n.id, &json!({"remind_at": "2026-01-01T09:00:00.000Z"}))
|
||||
.expect("remind");
|
||||
update_note(
|
||||
&conn,
|
||||
&n.id,
|
||||
&json!({"remind_at": "2026-01-01T09:00:00.000Z"}),
|
||||
)
|
||||
.expect("remind");
|
||||
let done = complete_reminder(&conn, &n.id).expect("complete");
|
||||
assert!(done.remind_at.is_none());
|
||||
assert!(done.recurrence.is_none());
|
||||
@@ -1345,12 +1402,24 @@ mod tests {
|
||||
let later = note(&conn, "later");
|
||||
let sooner = note(&conn, "sooner");
|
||||
let binned = note(&conn, "binned");
|
||||
update_note(&conn, &later.id, &json!({"remind_at": "2026-12-02T09:00:00.000Z"}))
|
||||
.expect("remind");
|
||||
update_note(&conn, &sooner.id, &json!({"remind_at": "2026-12-01T09:00:00.000Z"}))
|
||||
.expect("remind");
|
||||
update_note(&conn, &binned.id, &json!({"remind_at": "2026-11-01T09:00:00.000Z"}))
|
||||
.expect("remind");
|
||||
update_note(
|
||||
&conn,
|
||||
&later.id,
|
||||
&json!({"remind_at": "2026-12-02T09:00:00.000Z"}),
|
||||
)
|
||||
.expect("remind");
|
||||
update_note(
|
||||
&conn,
|
||||
&sooner.id,
|
||||
&json!({"remind_at": "2026-12-01T09:00:00.000Z"}),
|
||||
)
|
||||
.expect("remind");
|
||||
update_note(
|
||||
&conn,
|
||||
&binned.id,
|
||||
&json!({"remind_at": "2026-11-01T09:00:00.000Z"}),
|
||||
)
|
||||
.expect("remind");
|
||||
trash(&conn, &binned.id).expect("trash");
|
||||
assert_eq!(
|
||||
ids(&reminders(&conn).expect("reminders")),
|
||||
@@ -1366,7 +1435,7 @@ mod tests {
|
||||
let work = create_label(&conn, "work").expect("label");
|
||||
let jobs = create_label(&conn, "jobs").expect("label");
|
||||
let n = note(&conn, "task");
|
||||
set_labels(&conn, &n.id, &[jobs.id.clone()]).expect("labels");
|
||||
set_labels(&conn, &n.id, std::slice::from_ref(&jobs.id)).expect("labels");
|
||||
|
||||
let survivor = rename_label(&conn, &jobs.id, "Work").expect("rename");
|
||||
assert_eq!(survivor.id, work.id);
|
||||
@@ -1383,8 +1452,8 @@ mod tests {
|
||||
let home = create_label(&conn, "home").expect("label");
|
||||
let kept = note(&conn, "kept");
|
||||
let binned = note(&conn, "binned");
|
||||
set_labels(&conn, &kept.id, &[home.id.clone()]).expect("labels");
|
||||
set_labels(&conn, &binned.id, &[home.id.clone()]).expect("labels");
|
||||
set_labels(&conn, &kept.id, std::slice::from_ref(&home.id)).expect("labels");
|
||||
set_labels(&conn, &binned.id, std::slice::from_ref(&home.id)).expect("labels");
|
||||
trash(&conn, &binned.id).expect("trash");
|
||||
assert_eq!(list_labels(&conn).expect("labels")[0].count, Some(1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user