tien238lnd commented on code in PR #45176:
URL: https://github.com/apache/superset/pull/45176#discussion_r4267292378


##########
superset-frontend/src/pages/DatasetList/DatasetList.test.tsx:
##########
@@ -650,3 +636,36 @@ test.each([false, true])(
     }
   },
 );
+
+const listRequestUrls = (pattern: RegExp) =>
+  fetchMock.callHistory
+    .calls()
+    .map(call => call.url)
+    .filter(url => pattern.test(url));
+
+test('lists datasets through the dataset API when semantic layers are off', 
async () => {
+  renderDatasetList(mockAdminUser);
+
+  await waitFor(() => {
+    expect(listRequestUrls(/\/api\/v1\/dataset\/\?q=/).length).toBeGreaterThan(
+      0,
+    );
+  });
+  expect(listRequestUrls(/\/api\/v1\/datasource\/\?q=/)).toHaveLength(0);
+});
+
+test('lists datasets through the combined datasource API when semantic layers 
are on', async () => {

Review Comment:
   Added in the latest push: two tests that run with `SEMANTIC_LAYERS` on 
against `/api/v1/datasource/`, one for the name filter reaching the combined 
endpoint and one for sorting (`order_column=table_name`), both asserting 
nothing goes to `/api/v1/dataset/`. The refresh after delete or duplicate stays 
asserted on the dataset endpoint only, since the flag-on path of that refresh 
goes through the same `fetchData`.
   
   _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_



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