sadpandajoe commented on code in PR #45337:
URL: https://github.com/apache/superset/pull/45337#discussion_r4294891842
##########
superset-frontend/src/pages/ActionLog/ActionLog.test.tsx:
##########
@@ -88,3 +88,56 @@ test('sorting by Action sends order_column=action as a
positive control', async
).toBe(true),
);
});
+
+test('JSON column opens a tree modal for object payloads', async () => {
+ fetchMock.removeRoutes();
+ fetchMock.get('glob:*/api/v1/log/_info*', { permissions: ['can_read'] });
+ fetchMock.get(logEndpoint, {
+ result: [{ ...mockLogs[0], json: '{"path":"/superset/welcome/","n":1}' }],
+ count: 1,
+ });
+ renderActionLog();
+
+ await userEvent.click(
+ await screen.findByText('{"path":"/superset/welcome/","n":1}'),
+ );
+
+ const dialog = await screen.findByRole('dialog');
+ expect(dialog).toHaveTextContent('path');
Review Comment:
These two assertions would also pass if the raw JSON string were handed to
the modal as the tree data instead of the parsed object: the string renders as
a single leaf that contains both `path` and `/superset/welcome/`, so the test
would stay green while users lose the collapsible tree. Could this assert on
separate key and value nodes (or on the parsed object reaching the tree) so it
actually pins the tree behavior?
--
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]