geido commented on code in PR #21189:
URL: https://github.com/apache/superset/pull/21189#discussion_r954900941
##########
superset-frontend/src/views/CRUD/data/dataset/AddDataset/AddDataset.test.tsx:
##########
@@ -17,17 +17,28 @@
* under the License.
*/
import React from 'react';
-import { render, screen } from 'spec/helpers/testing-library';
+import { render, screen, act } from 'spec/helpers/testing-library';
import AddDataset from 'src/views/CRUD/data/dataset/AddDataset';
describe('AddDataset', () => {
- it('renders a blank state AddDataset', () => {
- render(<AddDataset />);
+ const renderAndWait = async () => {
Review Comment:
If the purpose here to wait until the component has finished loading, you
can use something like this
```
const waitForRender = () => waitFor(() => render(<AddDataset />);
await waitForRender();
```
##########
superset-frontend/src/views/CRUD/data/dataset/AddDataset/AddDataset.test.tsx:
##########
@@ -17,17 +17,28 @@
* under the License.
*/
import React from 'react';
-import { render, screen } from 'spec/helpers/testing-library';
+import { render, screen, act } from 'spec/helpers/testing-library';
import AddDataset from 'src/views/CRUD/data/dataset/AddDataset';
describe('AddDataset', () => {
- it('renders a blank state AddDataset', () => {
- render(<AddDataset />);
+ const renderAndWait = async () => {
Review Comment:
If the purpose here to wait until the component has finished loading, you
can use something like this
```
const waitForRender = () => waitFor(() => render(<AddDataset />));
await waitForRender();
```
--
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]