rusackas commented on code in PR #44366:
URL: https://github.com/apache/superset/pull/44366#discussion_r4131717388
##########
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx:
##########
@@ -477,9 +477,11 @@ const FiltersConfigForm = (
formFilter?.filterType,
);
Review Comment:
Good catch, fixed to use `itemTypeField` and added the first-paint assertion
for the pre-filter control right alongside the dependency-control test.
##########
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx:
##########
@@ -532,6 +535,28 @@ test('deletes a filter including dependencies', async ()
=> {
);
}, 30000);
+test('shows the dependency control on first render for a saved cascade
filter', () => {
+ const nativeFilterConfig = [
+ buildNativeFilter('NATIVE_FILTER-1', 'state', ['NATIVE_FILTER-2']),
+ buildNativeFilter('NATIVE_FILTER-2', 'country', []),
+ ];
+ const state = {
+ ...defaultState(),
+ dashboardInfo: {
+ metadata: {
+ native_filter_configuration: nativeFilterConfig,
+ },
+ },
+ dashboardLayout,
+ };
+ defaultRender(state, { ...props, createNewOnOpen: false });
+
+ // No interaction: the dependency control and its saved parent must be
+ // visible as soon as the modal opens on a filter that already has a
+ // cascade parent, without waiting for a rerender.
+ expect(getCheckbox(DEPENDENCIES_REGEX)).toBeChecked();
Review Comment:
Added an assertion that the saved parent actually renders as the selected
value, not the deleted-or-invalid placeholder, and trimmed the comment to match
what's checked.
--
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]