bito-code-review[bot] commented on PR #38707:
URL: https://github.com/apache/superset/pull/38707#issuecomment-4084230566
<!-- Bito Reply -->
The suggestion to add a focused unit test is solid—it directly addresses the
regression risk by asserting the `.ant-tag` color uses `getColorVariants(theme,
type).text` instead of `.active`, especially for custom themes.
**superset-frontend/packages/superset-ui-core/src/components/Label/__tests__/index.test.tsx**
```
import { render } from '@testing-library/react';
import { Label } from '../index';
import { getColorVariants } from '../../../color';
describe('Label', () => {
it('uses text color variant for .ant-tag', () => {
const theme = { colors: { primary: { text: '#000', active: '#fff' } } };
const { container } = render(<Label type="primary" theme={theme} />);
const tag = container.querySelector('.ant-tag');
expect(tag).toHaveStyle({ color: getColorVariants(theme, 'primary').text
});
});
});
```
--
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]