color-ui tests: a small-grid CMYK profile; the picker's rooms compared in one look

The invalid-capture test needs a valid CMYK profile, not the shipped one's
21-node BToA grid. The full-picker test checks each look's arrangement in the
wide room and compares the other rooms in the widest look.
This commit is contained in:
aiongg
2026-11-24 19:56:06 +00:00
parent d56ee32e1e
commit 02f2fc0443
2 changed files with 11 additions and 3 deletions
+7 -1
View File
@@ -299,7 +299,10 @@ fn the_full_picker_keeps_photoshops_arrangement_in_every_room_density_and_theme(
for look in LOOKS {
let wide = full_picker(600.0, look, 2);
let parts = FullParts::of(&wide, 2);
the_arrangement_holds_in_other_rooms(look, &wide, &parts);
// The rooms are compared in one look, the widest: each look's own arrangement is checked below.
if look == ROOMS_LOOK {
the_arrangement_holds_in_other_rooms(look, &wide, &parts);
}
the_area_strip_and_compare_block_stand_as_in_photoshop(look, &parts);
the_field_groups_stand_under_the_compare_block(look, &parts);
the_hex_field_and_the_rows_under_the_area_stand_as_in_photoshop(look, &parts);
@@ -313,6 +316,9 @@ fn the_full_picker_keeps_photoshops_arrangement_in_every_room_density_and_theme(
type Look = (Size, &'static str);
/// The look the other rooms are compared in: the comfortable density is the widest, so a narrow room presses it most.
const ROOMS_LOOK: Look = (Size::Comfortable, "craft.studio");
/// Wider and narrower rooms leave the arrangement alone, and the warnings move no other part.
fn the_arrangement_holds_in_other_rooms(look: Look, wide: &Fixture, parts: &FullParts) {
assert_eq!(&FullParts::of(&full_picker(1200.0, look, 2), 2), parts, "{look:?}: the same arrangement in a room 1200 wide");
+4 -2
View File
@@ -202,9 +202,11 @@ fn an_invalid_capture_ends_the_pick_with_a_status() {
assert!(pick.take_status(&words).is_some(), "and says why");
assert!(pick.take_status(&words).is_none(), "once");
// A valid profile of another colour space: a CMYK monitor profile is not an RGB profile.
// A valid profile of another colour space: a CMYK monitor profile is not an RGB profile. The smallest grids make
// it as valid as the default coated profile, which takes far longer to build.
let mut odd = monitor([0, 0], [4, 4], 1);
odd.icc_profile = Some(craft_cms::synth::coated_cmyk().expect("the synthetic CMYK profile").to_bytes());
let params = craft_cms::synth::CmykParams { grid_a2b: 2, grid_b2a: 2, ..craft_cms::synth::CmykParams::default() };
odd.icc_profile = Some(craft_cms::synth::cmyk_profile(&params).expect("the synthetic CMYK profile").to_bytes());
let mut pick = ScreenPick::new();
pick.start("a");
pick.tick_with(&ctx, 1, &|| images(vec![odd.clone()]));