FrancescoCastaldi commented on code in PR #45051:
URL: https://github.com/apache/superset/pull/45051#discussion_r4252786424


##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.test.tsx:
##########
@@ -197,6 +197,15 @@ test('does not fetch data when filter has not been in 
view', () => {
   expect(mockRequestChartData).not.toHaveBeenCalled();
 });
 
+test('fetches data when inView is false if filter has requiredFirst', () => {
+  const requiredFirstFilter = createMockFilter({
+    requiredFirst: true,
+  });
+  renderFilterValue({ filter: requiredFirstFilter, inView: false });
+

Review Comment:
   Fixed in 9193ccaee7: added mockRequestChartData.mockReturnValue(new 
Promise(() => {})) at the start of the test so it does not rely on the default 
mock return value configured by preceding tests when run in isolation.



##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.test.tsx:
##########
@@ -197,6 +197,15 @@ test('does not fetch data when filter has not been in 
view', () => {
   expect(mockRequestChartData).not.toHaveBeenCalled();
 });
 
+test('fetches data when inView is false if filter has requiredFirst', () => {

Review Comment:
   Fixed in 9193ccaee7: added the sibling test rendering requiredFirst: true 
with filterType: 'filter_time' and inView: false, asserting 
expect(mockRequestChartData).not.toHaveBeenCalled().



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