fix(explore): edit datasource does not update control states (#10284)

This commit is contained in:
Jesse Yang
2020-07-10 12:46:25 -07:00
committed by GitHub
parent 4e4ccd48d6
commit 4d179622fa
8 changed files with 86 additions and 15 deletions

View File

@@ -41,6 +41,9 @@ const defaultProps = {
name: 'main',
},
},
actions: {
setDatasource: sinon.spy(),
},
onChange: sinon.spy(),
};
@@ -71,15 +74,15 @@ describe('DatasourceControl', () => {
let wrapper = setup();
expect(wrapper.find('#datasource_menu')).toHaveLength(1);
expect(wrapper.find('#datasource_menu').dive().find(MenuItem)).toHaveLength(
2,
3,
);
wrapper = setup({
onDatasourceSave: () => {},
isEditable: false,
});
expect(wrapper.find('#datasource_menu')).toHaveLength(1);
expect(wrapper.find('#datasource_menu').dive().find(MenuItem)).toHaveLength(
3,
2,
);
});
});