mirror of
https://github.com/apache/superset.git
synced 2026-04-18 07:35:09 +00:00
fix(alert/report): alert modal loading dropdown options (#13222)
* alert modal loading * add ui test
This commit is contained in:
@@ -35,6 +35,8 @@ const mockData = {
|
||||
id: 1,
|
||||
name: 'test report',
|
||||
description: 'test report description',
|
||||
chart: { id: 1, slice_name: 'test chart' },
|
||||
database: { id: 1, database_name: 'test database' },
|
||||
};
|
||||
const FETCH_REPORT_ENDPOINT = 'glob:*/api/v1/report/*';
|
||||
const REPORT_PAYLOAD = { result: mockData };
|
||||
@@ -149,6 +151,24 @@ describe('AlertReportModal', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('renders async select with value in alert edit modal', async () => {
|
||||
const props = {
|
||||
...mockedProps,
|
||||
alert: mockData,
|
||||
isReport: false,
|
||||
};
|
||||
|
||||
const editWrapper = await mountAndWait(props);
|
||||
expect(editWrapper.find(AsyncSelect).at(1).props().value).toEqual({
|
||||
value: 1,
|
||||
label: 'test database',
|
||||
});
|
||||
expect(editWrapper.find(AsyncSelect).at(2).props().value).toEqual({
|
||||
value: 1,
|
||||
label: 'test chart',
|
||||
});
|
||||
});
|
||||
|
||||
// Fields
|
||||
it('renders input element for name', () => {
|
||||
expect(wrapper.find('input[name="name"]')).toExist();
|
||||
|
||||
Reference in New Issue
Block a user