@@ -141,6 +141,62 @@ describe('DAG Node', () => {
141141 expect ( createGroup ) . not . toThrow ( ) ;
142142 } ) ;
143143
144+ it ( 'Allows overriding the background color for a node state badge' ,
145+ fakeAsync ( async ( ) => {
146+ const customBgColor = 'rgb(128, 0, 128)' ;
147+ const node = new DagNode ( 'c' , 'execution' , 'FAILED' , {
148+ stateBgColor : customBgColor ,
149+ } ) ;
150+ fixture . componentInstance . fakeNode = node ;
151+
152+ const stateElement = await harness . nodeStateElement ( ) ;
153+ const style = await stateElement . getAttribute ( 'style' ) ;
154+ expect ( style ) . toContain ( `background: ${ customBgColor } ` ) ;
155+ } ) ) ;
156+
157+ it ( 'Allows overriding the background color for a group state badge' ,
158+ fakeAsync ( async ( ) => {
159+ const customBgColor = 'rgb(128, 0, 128)' ;
160+ const group = new DagGroup ( 'group-id' , [ ] , [ ] , [ ] , 'FAILED' , {
161+ stateBgColor : customBgColor ,
162+ hasControlNode : true ,
163+ } ) ;
164+ fixture . componentInstance . fakeNode = group . generateControlNode ( ) ! ;
165+ fixture . detectChanges ( ) ;
166+
167+ const stateElement = await harness . nodeStateElement ( ) ;
168+ const style = await stateElement . getAttribute ( 'style' ) ;
169+ expect ( style ) . toContain ( `background: ${ customBgColor } ` ) ;
170+ } ) ) ;
171+
172+ it ( 'Allows overriding the state icon color for a node' ,
173+ fakeAsync ( async ( ) => {
174+ const customStateIconColor = 'rgb(128, 0, 128)' ;
175+ const node = new DagNode ( 'c' , 'execution' , 'FAILED' , {
176+ stateIconColor : customStateIconColor ,
177+ } ) ;
178+ fixture . componentInstance . fakeNode = node ;
179+
180+ const stateElement = await harness . nodeStateElement ( ) ;
181+ const style = await stateElement . getAttribute ( 'style' ) ;
182+ expect ( style ) . toContain ( `color: ${ customStateIconColor } ` ) ;
183+ } ) ) ;
184+
185+ it ( 'Allows overriding the state icon color for a group' ,
186+ fakeAsync ( async ( ) => {
187+ const customStateIconColor = 'rgb(128, 0, 128)' ;
188+ const group = new DagGroup ( 'group-id' , [ ] , [ ] , [ ] , 'FAILED' , {
189+ stateIconColor : customStateIconColor ,
190+ hasControlNode : true ,
191+ } ) ;
192+ fixture . componentInstance . fakeNode = group . generateControlNode ( ) ! ;
193+ fixture . detectChanges ( ) ;
194+
195+ const stateElement = await harness . nodeStateElement ( ) ;
196+ const style = await stateElement . getAttribute ( 'style' ) ;
197+ expect ( style ) . toContain ( `color: ${ customStateIconColor } ` ) ;
198+ } ) ) ;
199+
144200 } ) ;
145201
146202 describe ( 'Internals' , ( ) => {
0 commit comments