fix(Dashboard): Only apply changes when editing properties (#17392)
* Apply only * Test apply button * Update Cypress * Rename test
This commit is contained in:
parent
9ce6b7de83
commit
0712be4c12
|
|
@ -103,7 +103,7 @@ describe('Dashboard edit action', () => {
|
|||
|
||||
// save edit changes
|
||||
cy.get('.ant-modal-footer')
|
||||
.contains('Save')
|
||||
.contains('Apply')
|
||||
.click()
|
||||
.then(() => {
|
||||
// assert that modal edit window has closed
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* 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 userEvent from '@testing-library/user-event';
|
||||
import fetchMock from 'fetch-mock';
|
||||
import { HeaderDropdownProps } from 'src/dashboard/components/Header/types';
|
||||
|
|
@ -198,3 +198,12 @@ test('should show the properties modal', async () => {
|
|||
userEvent.click(screen.getByText('Edit dashboard properties'));
|
||||
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();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -629,6 +629,7 @@ class Header extends React.PureComponent {
|
|||
);
|
||||
}
|
||||
}}
|
||||
onlyApply
|
||||
/>
|
||||
)}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue