fix(alert/report): alert modal loading dropdown options (#13222)

* alert modal loading

* add ui test
This commit is contained in:
Lily Kuang
2021-02-21 17:59:33 -08:00
committed by GitHub
parent 4bc2daf4c1
commit d8bd8ec896
5 changed files with 74 additions and 18 deletions

View File

@@ -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();