michael-s-molina commented on code in PR #21351:
URL: https://github.com/apache/superset/pull/21351#discussion_r989992051


##########
superset-frontend/src/components/Chart/DrillDetail/DrillDetailMenuItems.test.tsx:
##########
@@ -0,0 +1,343 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import userEvent from '@testing-library/user-event';
+import { render, screen, within } from 'spec/helpers/testing-library';
+import { getMockStoreWithNativeFilters } from 'spec/fixtures/mockStore';
+import chartQueries, { sliceId } from 'spec/fixtures/mockChartQueries';
+import { QueryObjectFilterClause } from '@superset-ui/core';
+import { Menu } from 'src/components/Menu';
+import DrillDetailMenuItems, {
+  DrillDetailMenuItemsProps,
+} from './DrillDetailMenuItems';
+
+/* eslint jest/expect-expect: ["warn", { "assertFunctionNames": ["expect*"] }] 
*/

Review Comment:
   > That being said, I mostly just don't really understand the reasoning 
behind the default settings on this lint rule – what's the argument for having 
expect calls only at the top level of each test? It seems to me like having a 
rule against factoring out shared test logic encourages writing less thorough 
tests and makes tests more brittle and less readable, but if I'm missing 
something here I can go ahead and rewrite these to have expect at the top level.
   
   The main reason for this lint rule is to prevent tests without assertions. 
Unfortunately, the rule is not smart enough to check helper functions. Another 
point is that unit tests generally don't share much logic so the default value 
makes sense for them. When we write integration tests like you're doing here, 
then shared logic is more common. In that case, it makes sense to disable the 
rule as you did if the code looks more readable 👍🏼 



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