Tests: Color filter with no matching layers and an unknown colour through ui.set (FredApps review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hector VillarrealandClaude Opus 5.5 committed 2026-11-02 11:21:29 -06:00
1 parent 7439eb7179
commit 1ce90f0ae0
2 files changed
+2

No files matched your search

+1
View File
@@ -900,6 +900,7 @@ fn ui_set_drives_the_layers_panel_filter() {
json!({"layerFilter": {"kinds": "pixel"}}),
json!({"layerFilter": {"name": 3}}),
json!({"layerFilter": {"mode": "Nonsense"}}),
json!({"layerFilter": {"color": "crimson"}}),
json!({"layerFilter": {"by": "kind", "extra": true}}),
json!({"layerFilter": {"by": "kind"}, "tileGrid": "yes"}),
] {
@@ -153,6 +153,7 @@ fn the_color_filter_lists_one_label() {
assert_eq!(listed(doc, &by_color(photocraft_doc::LabelColor::Red)), ["Ink"]);
assert_eq!(listed(doc, &by_color(photocraft_doc::LabelColor::Seafoam)), ["Sheets", "Paper"]);
assert_eq!(listed(doc, &by_color(photocraft_doc::LabelColor::None)), ["ink notes", "Background"]);
assert!(listed(doc, &by_color(photocraft_doc::LabelColor::Blue)).is_empty(), "a colour no layer has lists nothing");
// Over the control channel.
let f = super::patched(&UiState::default(), &json!({"by": "color", "color": "red"})).unwrap();
assert_eq!((f.by, f.color), (FilterBy::Color, photocraft_doc::LabelColor::Red));