Revert "fix(Dashboard): Only apply changes when editing properties (#17392)" (#17618)

This reverts commit 0712be4c12.
This commit is contained in:
Geido 2021-12-01 20:35:55 +02:00 committed by GitHub
parent c6ba9bf9db
commit 8963cca265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 12 deletions

View File

@ -103,7 +103,7 @@ describe('Dashboard edit action', () => {
// save edit changes // save edit changes
cy.get('.ant-modal-footer') cy.get('.ant-modal-footer')
.contains('Apply') .contains('Save')
.click() .click()
.then(() => { .then(() => {
// assert that modal edit window has closed // assert that modal edit window has closed

View File

@ -17,7 +17,7 @@
* under the License. * under the License.
*/ */
import React from 'react'; import React from 'react';
import { render, screen, waitFor } from 'spec/helpers/testing-library'; import { render, screen } from 'spec/helpers/testing-library';
import userEvent from '@testing-library/user-event'; import userEvent from '@testing-library/user-event';
import fetchMock from 'fetch-mock'; import fetchMock from 'fetch-mock';
import { HeaderDropdownProps } from 'src/dashboard/components/Header/types'; import { HeaderDropdownProps } from 'src/dashboard/components/Header/types';
@ -198,12 +198,3 @@ test('should show the properties modal', async () => {
userEvent.click(screen.getByText('Edit dashboard properties')); userEvent.click(screen.getByText('Edit dashboard properties'));
expect(editModeOnProps.showPropertiesModal).toHaveBeenCalledTimes(1); expect(editModeOnProps.showPropertiesModal).toHaveBeenCalledTimes(1);
}); });
test('should display the Apply button when opening the modal', async () => {
render(setup(editModeOnProps));
await openDropdown();
userEvent.click(screen.getByText('Edit dashboard properties'));
waitFor(() => {
expect(screen.getByRole('button', { name: 'Apply' })).toBeInTheDocument();
});
});

View File

@ -638,7 +638,6 @@ class Header extends React.PureComponent {
); );
} }
}} }}
onlyApply
/> />
)} )}