44 differingFraction ,
55 floatVoxels ,
66 nrrd ,
7+ showColorPresets ,
78 openWith3DLayout ,
9+ selectedPreset ,
810 writeNrrd ,
911} from './volumeTestUtils' ;
1012
@@ -84,7 +86,7 @@ describe('3D rendering color and opacity reset', () => {
8486 return Math . max ( 0 , 1000 * ( 1 - Math . hypot ( ...offsets ) / ( SIZE / 2 ) ) ) ;
8587 } ) ;
8688 await openWith3DLayout (
87- writeNrrd ( name , nrrd ( [ ] , 'float' , SIZE ) , voxels ) ,
89+ writeNrrd ( name , nrrd ( [ 'modality:=MR' ] , 'float' , SIZE ) , voxels ) ,
8890 name
8991 ) ;
9092 await volViewPage . renderingModuleTab . waitForClickable ( ) ;
@@ -97,6 +99,13 @@ describe('3D rendering color and opacity reset', () => {
9799 'Reset color and opacity'
98100 ) ;
99101
102+ // Reset must keep a preset chosen over the MR default.
103+ await showColorPresets ( ) ;
104+ await $ ( '.thumbnail-container*=Grayscale' ) . click ( ) ;
105+ await expect ( selectedPreset ( ) ) . toHaveText ( 'Grayscale' ) ;
106+ // The open preset grid pushes the opacity editor out of the capture area.
107+ await showColorPresets ( false ) ;
108+
100109 // A gaussian stays highlighted once clicked, so select it before the baseline.
101110 await dragOpacityCurve ( 0 ) ;
102111 await pressOn ( ambientThumb ( ) , 'ArrowRight' ) ;
@@ -134,5 +143,7 @@ describe('3D rendering color and opacity reset', () => {
134143 'Expected reset to restore the opacity curve and color bar'
135144 ) ;
136145 await expect ( ambientThumb ( ) ) . toHaveAttribute ( 'aria-valuenow' , '0.3' ) ;
146+ await showColorPresets ( ) ;
147+ await expect ( selectedPreset ( ) ) . toHaveText ( 'Grayscale' ) ;
137148 } ) . timeout ( 180_000 ) ;
138149} ) ;
0 commit comments