Copilot commented on code in PR #36771:
URL: https://github.com/apache/superset/pull/36771#discussion_r2662571718


##########
superset-frontend/src/components/StreamingExportModal/useStreamingExport.test.ts:
##########
@@ -16,10 +16,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+import { TextEncoder, TextDecoder } from 'util';
 import { renderHook, act } from '@testing-library/react-hooks';
+import { waitFor } from '@testing-library/react';
 import { useStreamingExport } from './useStreamingExport';
 import { ExportStatus } from './StreamingExportModal';
 
+// Polyfill TextEncoder/TextDecoder for Jest environment
+global.TextEncoder = TextEncoder;
+global.TextDecoder = TextDecoder as typeof global.TextDecoder;

Review Comment:
   These global polyfills are set up outside of test lifecycle hooks. This 
means they persist across all tests in the file and could potentially interfere 
with other test files if Jest's test isolation isn't perfect. Move these 
assignments into a `beforeAll()` hook to make the setup more explicit and 
contained within the test file's lifecycle.



-- 
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