mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
fix(alert/report): add/edit modal issue (#12955)
* fix alert modal * add test for edit modal
This commit is contained in:
@@ -105,6 +105,11 @@ describe('AlertReportModal', () => {
|
||||
expect(wrapper.find(Modal)).toExist();
|
||||
});
|
||||
|
||||
it('render a empty modal', () => {
|
||||
expect(wrapper.find('input[name="name"]').text()).toEqual('');
|
||||
expect(wrapper.find('input[name="description"]').text()).toEqual('');
|
||||
});
|
||||
|
||||
it('renders add header for report when no alert is included, and isReport is true', async () => {
|
||||
const addWrapper = await mountAndWait();
|
||||
|
||||
@@ -126,10 +131,22 @@ describe('AlertReportModal', () => {
|
||||
).toEqual('Add Alert');
|
||||
});
|
||||
|
||||
it.skip('renders edit header when alert prop is included', () => {
|
||||
it('renders edit modal', async () => {
|
||||
const props = {
|
||||
...mockedProps,
|
||||
alert: mockData,
|
||||
};
|
||||
|
||||
const editWrapper = await mountAndWait(props);
|
||||
expect(
|
||||
wrapper.find('[data-test="alert-report-modal-title"]').text(),
|
||||
editWrapper.find('[data-test="alert-report-modal-title"]').text(),
|
||||
).toEqual('Edit Report');
|
||||
expect(editWrapper.find('input[name="name"]').props().value).toEqual(
|
||||
'test report',
|
||||
);
|
||||
expect(editWrapper.find('input[name="description"]').props().value).toEqual(
|
||||
'test report description',
|
||||
);
|
||||
});
|
||||
|
||||
// Fields
|
||||
|
||||
Reference in New Issue
Block a user