()
| 1255 | |
| 1256 | #[test] |
| 1257 | fn test_store_default_by_usage() { |
| 1258 | let (_temp, mut store) = create_test_store(); |
| 1259 | |
| 1260 | let personal = Identity::builder("alice-personal") |
| 1261 | .usage(IdentityUsage::Personal) |
| 1262 | .build() |
| 1263 | .unwrap(); |
| 1264 | let work = Identity::builder("alice-work") |
| 1265 | .usage(IdentityUsage::Work) |
| 1266 | .build() |
| 1267 | .unwrap(); |
| 1268 | |
| 1269 | store.save(&personal).unwrap(); |
| 1270 | store.save(&work).unwrap(); |
| 1271 | |
| 1272 | store |
| 1273 | .set_default_for_usage(&IdentityUsage::Work, &work.id) |
| 1274 | .unwrap(); |
| 1275 | |
| 1276 | let work_default = store |
| 1277 | .get_default_for_usage(&IdentityUsage::Work) |
| 1278 | .unwrap() |
| 1279 | .unwrap(); |
| 1280 | assert_eq!(work_default.id, work.id); |
| 1281 | |
| 1282 | // Personal should fall back to None (no global default set) |
| 1283 | assert!(store |
| 1284 | .get_default_for_usage(&IdentityUsage::Personal) |
| 1285 | .unwrap() |
| 1286 | .is_none()); |
| 1287 | } |
| 1288 | |
| 1289 | #[test] |
| 1290 | fn test_store_exists() { |
nothing calls this directly
no test coverage detected