You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/03/17 14:45:35 UTC

[GitHub] [superset] yardz opened a new pull request #13668: test: DataTableControl

yardz opened a new pull request #13668:
URL: https://github.com/apache/superset/pull/13668


   ### SUMMARY
   Tests for DataTableControl file
   
   ### TEST PLAN
   No behavior changes. All tests must pass.
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #13668: test: DataTableControl

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13668:
URL: https://github.com/apache/superset/pull/13668#issuecomment-801200911






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a change in pull request #13668: test: DataTableControl

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #13668:
URL: https://github.com/apache/superset/pull/13668#discussion_r596872688



##########
File path: superset-frontend/src/explore/components/DataTableControl/RowCount.test.tsx
##########
@@ -0,0 +1,31 @@
+/**
+ * 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 { render, screen } from 'spec/helpers/testing-library';
+import { RowCount } from '.';
+
+test('Render a RowCount', async () => {

Review comment:
       ```suggestion
   test('Render a RowCount', () => {
   ```

##########
File path: superset-frontend/src/explore/components/DataTableControl/RowCount.test.tsx
##########
@@ -0,0 +1,31 @@
+/**
+ * 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 { render, screen } from 'spec/helpers/testing-library';
+import { RowCount } from '.';
+
+test('Render a RowCount', async () => {
+  render(<RowCount data={[{}, {}, {}]} loading={false} />);
+  expect(screen.getByText('3 rows retrieved')).toBeInTheDocument();
+});
+
+test('Render a RowCount on loading', async () => {

Review comment:
       ```suggestion
   test('Render a RowCount on loading', () => {
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] yardz commented on pull request #13668: test: DataTableControl

Posted by GitBox <gi...@apache.org>.
yardz commented on pull request #13668:
URL: https://github.com/apache/superset/pull/13668#issuecomment-808293253


   @rusackas please take a look here!


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] yardz commented on a change in pull request #13668: test: DataTableControl

Posted by GitBox <gi...@apache.org>.
yardz commented on a change in pull request #13668:
URL: https://github.com/apache/superset/pull/13668#discussion_r599559411



##########
File path: superset-frontend/src/explore/components/DataTableControl/CopyButton.test.tsx
##########
@@ -0,0 +1,28 @@
+/**
+ * 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 { render, screen } from 'spec/helpers/testing-library';
+
+import { CopyButton } from '.';
+
+test('Render a button', () => {
+  render(<CopyButton>btn</CopyButton>);
+  expect(screen.getByRole('button')).toBeInTheDocument();
+  expect(screen.getByRole('button')).toHaveClass('superset-button');

Review comment:
       It doesn't really add much value. It’s just because a test that just checks that it’s a button doesn’t add much...




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] commented on pull request #13668: test: DataTableControl

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #13668:
URL: https://github.com/apache/superset/pull/13668#issuecomment-801200911


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13668?src=pr&el=h1) Report
   > Merging [#13668](https://codecov.io/gh/apache/superset/pull/13668?src=pr&el=desc) (37c510f) into [master](https://codecov.io/gh/apache/superset/commit/0e0c99b2fb4cb275b65cc1293bafafe4f91ba33a?el=desc) (0e0c99b) will **decrease** coverage by `3.37%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head 37c510f differs from pull request most recent head 3077dfe. Consider uploading reports for the commit 3077dfe to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13668/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13668?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13668      +/-   ##
   ==========================================
   - Coverage   76.46%   73.09%   -3.38%     
   ==========================================
     Files         921      611     -310     
     Lines       46769    21755   -25014     
     Branches     5644     5665      +21     
   ==========================================
   - Hits        35761    15901   -19860     
   + Misses      10848     5718    -5130     
   + Partials      160      136      -24     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `56.59% <ø> (+5.27%)` | :arrow_up: |
   | hive | `?` | |
   | javascript | `63.27% <100.00%> (+0.12%)` | :arrow_up: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `?` | |
   | python | `?` | |
   | sqlite | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13668?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [.../src/explore/components/DataTableControl/index.tsx](https://codecov.io/gh/apache/superset/pull/13668/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhVGFibGVDb250cm9sL2luZGV4LnRzeA==) | `86.00% <100.00%> (ø)` | |
   | [...nts/controls/DateFilterControl/DateFilterLabel.tsx](https://codecov.io/gh/apache/superset/pull/13668/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyTGFiZWwudHN4) | `67.10% <0.00%> (-4.58%)` | :arrow_down: |
   | [superset/dashboards/dao.py](https://codecov.io/gh/apache/superset/pull/13668/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9kYW8ucHk=) | | |
   | [superset/datasets/columns/api.py](https://codecov.io/gh/apache/superset/pull/13668/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YXNldHMvY29sdW1ucy9hcGkucHk=) | | |
   | [...notation\_layers/annotations/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/13668/diff?src=pr&el=tree#diff-c3VwZXJzZXQvYW5ub3RhdGlvbl9sYXllcnMvYW5ub3RhdGlvbnMvY29tbWFuZHMvZXhjZXB0aW9ucy5weQ==) | | |
   | [superset/models/schedules.py](https://codecov.io/gh/apache/superset/pull/13668/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL3NjaGVkdWxlcy5weQ==) | | |
   | [superset/datasets/commands/importers/v0.py](https://codecov.io/gh/apache/superset/pull/13668/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YXNldHMvY29tbWFuZHMvaW1wb3J0ZXJzL3YwLnB5) | | |
   | [superset/queries/saved\_queries/commands/export.py](https://codecov.io/gh/apache/superset/pull/13668/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcXVlcmllcy9zYXZlZF9xdWVyaWVzL2NvbW1hbmRzL2V4cG9ydC5weQ==) | | |
   | [superset/css\_templates/filters.py](https://codecov.io/gh/apache/superset/pull/13668/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY3NzX3RlbXBsYXRlcy9maWx0ZXJzLnB5) | | |
   | [superset/examples/tabbed\_dashboard.py](https://codecov.io/gh/apache/superset/pull/13668/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvdGFiYmVkX2Rhc2hib2FyZC5weQ==) | | |
   | ... and [363 more](https://codecov.io/gh/apache/superset/pull/13668/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13668?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13668?src=pr&el=footer). Last update [0e0c99b...3077dfe](https://codecov.io/gh/apache/superset/pull/13668?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] yardz commented on a change in pull request #13668: test: DataTableControl

Posted by GitBox <gi...@apache.org>.
yardz commented on a change in pull request #13668:
URL: https://github.com/apache/superset/pull/13668#discussion_r599559411



##########
File path: superset-frontend/src/explore/components/DataTableControl/CopyButton.test.tsx
##########
@@ -0,0 +1,28 @@
+/**
+ * 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 { render, screen } from 'spec/helpers/testing-library';
+
+import { CopyButton } from '.';
+
+test('Render a button', () => {
+  render(<CopyButton>btn</CopyButton>);
+  expect(screen.getByRole('button')).toBeInTheDocument();
+  expect(screen.getByRole('button')).toHaveClass('superset-button');

Review comment:
       It doesn't really add much value. It’s just because a test that just checks that it’s a button doesn’t add much... At least with the class I check if "added the correct button"




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas merged pull request #13668: test: DataTableControl

Posted by GitBox <gi...@apache.org>.
rusackas merged pull request #13668:
URL: https://github.com/apache/superset/pull/13668


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] geido commented on a change in pull request #13668: test: DataTableControl

Posted by GitBox <gi...@apache.org>.
geido commented on a change in pull request #13668:
URL: https://github.com/apache/superset/pull/13668#discussion_r598899413



##########
File path: superset-frontend/src/explore/components/DataTableControl/CopyButton.test.tsx
##########
@@ -0,0 +1,28 @@
+/**
+ * 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 { render, screen } from 'spec/helpers/testing-library';
+
+import { CopyButton } from '.';
+
+test('Render a button', () => {
+  render(<CopyButton>btn</CopyButton>);
+  expect(screen.getByRole('button')).toBeInTheDocument();
+  expect(screen.getByRole('button')).toHaveClass('superset-button');

Review comment:
       Just out of curiosity, why do you think checking the class here would benefit the tests?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org