rusackas commented on code in PR #42910:
URL: https://github.com/apache/superset/pull/42910#discussion_r4309433600


##########
superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx:
##########
@@ -238,3 +238,10 @@ test('handles undefined theme gracefully', () => {
 
   expect(() => render(<ColorPickerControl {...defaultProps} />)).not.toThrow();
 });
+
+test('trigger is exposed as a focusable button for keyboard users', () => {
+  const { container } = render(<ColorPickerControl {...defaultProps} />);
+  const trigger = container.querySelector('.ant-color-picker-trigger');
+  expect(trigger).toHaveAttribute('tabindex', '0');

Review Comment:
   Fair, that test only checked the static attributes and would stay green with 
the handler gone. Added tests that actually fire Enter and Space on the focused 
trigger and assert the popup opens, plus one checking a disabled trigger stays 
closed on both. Confirmed they fail if I rip the keydown handler out.



##########
superset-frontend/plugins/plugin-chart-echarts/test/utils/colors.test.ts:
##########
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { normalizeRgbaColor } from '../../src/utils/colors';
+
+const fallback = { r: 1, g: 2, b: 3, a: 1 };
+
+test('passes through an rgb object', () => {
+  expect(
+    normalizeRgbaColor({ r: 10, g: 20, b: 30, a: 0.5 }, fallback),
+  ).toEqual({ r: 10, g: 20, b: 30, a: 0.5 });
+});
+
+test('parses 6 and 3 digit hex strings', () => {

Review Comment:
   Agreed, added tests that run a carried-over hex color through the actual 
Waterfall and Candlestick transforms and check the generated series color, not 
just normalizeRgbaColor in isolation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to