@@ -55,6 +55,10 @@ function update() {
5555 run ( charts ) ;
5656 } , 0 ) ;
5757 } ) ;
58+
59+ testCase . querySelectorAll ( "option" ) . forEach ( ( option ) => {
60+ option . style . backgroundColor = option . selected ? "rgba(206,206,206,255)" : option . getAttribute ( "background-color" ) ;
61+ } ) ;
5862}
5963
6064function connectSliders ( ) {
@@ -132,7 +136,7 @@ function getVizzuOption(url, name) {
132136 option . value = url ;
133137 const text = document . createTextNode ( name ) ;
134138 option . appendChild ( text ) ;
135- return option
139+ return option ;
136140}
137141
138142function populateCases ( ) {
@@ -163,22 +167,22 @@ function populateCases() {
163167
164168function getTestCaseOption ( testCase , testCaseName , testCaseResult , selected ) {
165169 const option = document . createElement ( "option" ) ;
166- option . setAttribute ( "style" , getTestCaseStyle ( testCaseResult ) ) ;
167170 option . value = testCase ;
168171 option . selected = selected ;
169172 option . textContent = testCaseResult ? `${ testCaseName } | ${ testCaseResult } ` : testCaseName ;
173+ option . setAttribute ( "background-color" , getTestCaseBackgroundColorByResult ( testCaseResult ) ) ;
170174 return option ;
171175}
172176
173- function getTestCaseStyle ( testCaseResult ) {
177+ function getTestCaseBackgroundColorByResult ( testCaseResult ) {
174178 if ( testCaseResult === "PASS" ) {
175- return "background-color: rgba(152, 251, 152, 0.8) !important; " ;
179+ return "rgba(152,251,152,0.8)" ;
176180 } else if ( testCaseResult === "FAIL" ) {
177- return "background-color: rgba(255, 153, 153, 0.8) !important; " ;
181+ return "rgba(255,153,153,0.8)" ;
178182 } else if ( testCaseResult === "WARN" ) {
179- return "background-color: rgba(255, 255, 153, 0.8) !important; " ;
183+ return "rgba(255,255,153,0.8)" ;
180184 }
181- return ";"
185+ return "" ;
182186}
183187
184188populateLibs ( ) ;
0 commit comments