add SPA config UI, wire media/rss adapters, event-driven layout push
- React SPA: dashboard, data sources CRUD, widgets CRUD, layout builder, presets. TanStack Router + Query, shadcn/ui, Vite proxy to :3000 - wire media + rss adapters into polling loop, remove xtb source type - media adapter: read username/password from headers, proper subsonic auth - event handler: subscribe to LayoutChanged, push screen update to clients - fix clippy warnings across workspace (Default impls, collapsible ifs, redundant closures, is_none_or, unused imports)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use std::collections::BTreeMap;
|
||||
use domain::Value;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
#[test]
|
||||
fn estimated_size_of_string_is_its_byte_length() {
|
||||
@@ -29,37 +29,31 @@ fn estimated_size_of_nested_structure_sums_recursively() {
|
||||
|
||||
#[test]
|
||||
fn estimated_size_of_array_sums_elements() {
|
||||
let v = Value::Array(vec![
|
||||
Value::String("abc".into()),
|
||||
Value::Number(1.0),
|
||||
]);
|
||||
let v = Value::Array(vec![Value::String("abc".into()), Value::Number(1.0)]);
|
||||
assert_eq!(v.estimated_size(), 11);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_path_returns_none_for_missing_key() {
|
||||
let data = Value::Object(BTreeMap::from([
|
||||
("main".into(), Value::Number(1.0)),
|
||||
]));
|
||||
let data = Value::Object(BTreeMap::from([("main".into(), Value::Number(1.0))]));
|
||||
assert_eq!(data.get_path("$.missing"), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_path_returns_none_when_traversing_non_object() {
|
||||
let data = Value::Object(BTreeMap::from([
|
||||
("temp".into(), Value::Number(5.4)),
|
||||
]));
|
||||
let data = Value::Object(BTreeMap::from([("temp".into(), Value::Number(5.4))]));
|
||||
assert_eq!(data.get_path("$.temp.nested"), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_path_accesses_array_by_index() {
|
||||
let data = Value::Object(BTreeMap::from([
|
||||
("items".into(), Value::Array(vec![
|
||||
let data = Value::Object(BTreeMap::from([(
|
||||
"items".into(),
|
||||
Value::Array(vec![
|
||||
Value::String("first".into()),
|
||||
Value::String("second".into()),
|
||||
])),
|
||||
]));
|
||||
]),
|
||||
)]));
|
||||
assert_eq!(
|
||||
data.get_path("$.items[1]"),
|
||||
Some(&Value::String("second".into()))
|
||||
@@ -68,10 +62,9 @@ fn get_path_accesses_array_by_index() {
|
||||
|
||||
#[test]
|
||||
fn get_path_traverses_nested_object() {
|
||||
let data = Value::Object(BTreeMap::from([
|
||||
("main".into(), Value::Object(BTreeMap::from([
|
||||
("temp".into(), Value::Number(5.4)),
|
||||
]))),
|
||||
]));
|
||||
let data = Value::Object(BTreeMap::from([(
|
||||
"main".into(),
|
||||
Value::Object(BTreeMap::from([("temp".into(), Value::Number(5.4))])),
|
||||
)]));
|
||||
assert_eq!(data.get_path("$.main.temp"), Some(&Value::Number(5.4)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user