fnardin-maystreet commented on code in PR #32995:
URL: https://github.com/apache/superset/pull/32995#discussion_r3557927410
##########
superset-frontend/src/pages/ChartList/ChartList.listview.test.tsx:
##########
@@ -43,6 +43,24 @@ jest.mock('src/utils/export', () => ({
default: jest.fn(),
}));
+// Mock bootstrap data so isUserEditorOrAdmin's subject-based check resolves
+// the mock user (userId 1) as a subject editor of the fixtures below.
+jest.mock('src/utils/getBootstrapData', () => {
+ const actual = jest.requireActual('src/utils/getBootstrapData');
+ const { DEFAULT_BOOTSTRAP_DATA } = jest.requireActual('src/constants');
+ return {
+ __esModule: true,
+ ...actual,
+ default: jest.fn(() => ({
+ ...DEFAULT_BOOTSTRAP_DATA,
+ common: {
+ ...DEFAULT_BOOTSTRAP_DATA.common,
+ user_subjects: [1],
+ },
+ })),
+ };
+});
Review Comment:
getBootstrapData is never mocked outside of the static mock at the top of
the file. False positive
--
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]