From 02f2fc0443b1b39a0157804d4cdb3e1d2e6b5def Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 19:56:06 +0000 Subject: [PATCH] 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. --- crates/color-ui/tests/it/picker.rs | 8 +++++++- crates/color-ui/tests/it/sampling.rs | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/color-ui/tests/it/picker.rs b/crates/color-ui/tests/it/picker.rs index bc44235a8..7a00b133e 100644 --- a/crates/color-ui/tests/it/picker.rs +++ b/crates/color-ui/tests/it/picker.rs @@ -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"); diff --git a/crates/color-ui/tests/it/sampling.rs b/crates/color-ui/tests/it/sampling.rs index bdf5aec72..53ce25aa9 100644 --- a/crates/color-ui/tests/it/sampling.rs +++ b/crates/color-ui/tests/it/sampling.rs @@ -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(¶ms).expect("the synthetic CMYK profile").to_bytes()); let mut pick = ScreenPick::new(); pick.start("a"); pick.tick_with(&ctx, 1, &|| images(vec![odd.clone()]));