rusackas commented on code in PR #43054:
URL: https://github.com/apache/superset/pull/43054#discussion_r3890364208
##########
superset-frontend/src/pages/AlertReportList/AlertReportList.test.tsx:
##########
@@ -44,6 +45,22 @@ jest.mock('src/utils/getBootstrapData', () => ({
})),
}));
+// Mock withToasts HOC to inject default toast functions while preserving
explicit test spies passed via props
+jest.mock('src/components/MessageToasts/withToasts', () => ({
+ __esModule: true,
+ default: <P extends object>(Component: React.ComponentType<P>) =>
+ function MockWithToasts(props: P) {
+ const mergedProps = {
+ addDangerToast: jest.fn(),
+ addSuccessToast: jest.fn(),
+ addInfoToast: jest.fn(),
+ addWarningToast: jest.fn(),
+ ...props,
+ } as P;
+ return <Component {...mergedProps} />;
Review Comment:
That file's dropped from the current head, so this doesn't apply anymore.
Resolving.
##########
superset-frontend/src/pages/AlertReportList/index.tsx:
##########
@@ -191,23 +191,31 @@ function AlertList({
}
executingIdsRef.current.add(alertId);
+ const isReport = alert.type === 'Report';
executeReport(
alertId,
() => {
addSuccessToast(
- t('%(alertType)s "%(alertName)s" triggered successfully', {
- alertType: alert.type,
- alertName: alert.name,
- }),
+ isReport
+ ? t('Report "%(alertName)s" triggered successfully', {
Review Comment:
Same here, gone from the current head. Resolving.
##########
superset-frontend/package.json:
##########
@@ -265,6 +265,9 @@
"@swc/core": "^1.15.47",
"@swc/plugin-emotion": "^14.19.0",
"@swc/plugin-transform-imports": "^12.5.0",
+ "@superset-ui/eslint-plugin-i18n-strings":
"file:eslint-rules/eslint-plugin-i18n-strings",
Review Comment:
Checked the current head, the new @superset-ui/* entries are sitting right
where the formatter wants them and pre-commit's green now. Resolving.
--
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]