bito-code-review[bot] commented on PR #38679:
URL: https://github.com/apache/superset/pull/38679#issuecomment-4070904497
<!-- Bito Reply -->
Yes, the renderWithDefaultTheme and renderWithTokens functions in
PublishedLabel.test.tsx are identical to those in DatasetTypeLabel.test.tsx.
Both are new files in this PR with duplicate helper functions.
**superset-frontend/packages/superset-ui-core/src/components/Label/reusable/PublishedLabel.test.tsx**
```
function renderWithDefaultTheme(ui: ReactElement) {
return render(<ThemeProvider theme={supersetTheme}>{ui}</ThemeProvider>);
}
function renderWithTokens(
ui: ReactElement,
tokenOverrides: Record<string, string>,
) {
const customTheme = Theme.fromConfig({ token: tokenOverrides });
return render(<ThemeProvider
theme={customTheme.theme}>{ui}</ThemeProvider>);
}
```
**superset-frontend/packages/superset-ui-core/src/components/Label/reusable/DatasetTypeLabel.test.tsx**
```
function renderWithDefaultTheme(ui: ReactElement) {
return render(<ThemeProvider theme={supersetTheme}>{ui}</ThemeProvider>);
}
function renderWithTokens(
ui: ReactElement,
tokenOverrides: Record<string, string>,
) {
const customTheme = Theme.fromConfig({ token: tokenOverrides });
return render(<ThemeProvider
theme={customTheme.theme}>{ui}</ThemeProvider>);
}
```
--
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]