lyndsiWilliams commented on code in PR #21189:
URL: https://github.com/apache/superset/pull/21189#discussion_r959027168
##########
superset-frontend/src/views/CRUD/data/dataset/AddDataset/Header/Header.test.tsx:
##########
@@ -17,13 +17,34 @@
* under the License.
*/
import React from 'react';
-import { render, screen } from 'spec/helpers/testing-library';
+import { render, screen, waitFor } from 'spec/helpers/testing-library';
import Header from 'src/views/CRUD/data/dataset/AddDataset/Header';
describe('Header', () => {
- it('renders a blank state Header', () => {
- render(<Header />);
+ const mockSetDataset = jest.fn();
- expect(screen.getByText(/header/i)).toBeVisible();
+ const waitForRender = () =>
+ waitFor(() =>
+ render(<Header setDataset={mockSetDataset} datasetName="" />),
+ );
+
+ it('renders a blank state Header', async () => {
+ await waitForRender();
+
+ const datasetNameTextbox = screen.getByRole('textbox', {
+ name: /dataset name/i,
+ });
+ const saveButton = screen.getByRole('button', {
+ name: /save save/i,
+ });
+ const menuButton = screen.getByRole('button', {
+ name: /menu actions trigger/i,
+ });
+
+ expect(datasetNameTextbox).toBeVisible();
+ expect(saveButton).toBeVisible();
+ expect(saveButton).toBeDisabled();
+ expect(menuButton).toBeVisible();
+ expect(menuButton).toBeDisabled();
Review Comment:
Can do! Added in [`this
commit`](https://github.com/apache/superset/pull/21189/commits/0ba4ab1da0052e3431b2f0ddb649d5fcd4e28503).
--
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]