Add support for period character in table names (#7453)

* Move schema name handling in table names from frontend to backend

* Rename all_schema_names to get_all_schema_names

* Fix js errors

* Fix additional js linting errors

* Refactor datasource getters and fix linting errors

* Update js unit tests

* Add python unit test for get_table_names method

* Add python unit test for get_table_names method

* Fix js linting error
This commit is contained in:
Ville Brofeldt
2019-05-26 06:13:16 +03:00
committed by GitHub
parent 47ba2ad394
commit f7d3413a50
11 changed files with 147 additions and 136 deletions

View File

@@ -208,19 +208,20 @@ describe('TableSelector', () => {
it('test 1', () => {
wrapper.instance().changeTable({
value: 'birth_names',
value: { schema: 'main', table: 'birth_names' },
label: 'birth_names',
});
expect(wrapper.state().tableName).toBe('birth_names');
});
it('test 2', () => {
it('should call onTableChange with schema from table object', () => {
wrapper.setProps({ schema: null });
wrapper.instance().changeTable({
value: 'main.my_table',
label: 'my_table',
value: { schema: 'other_schema', table: 'my_table' },
label: 'other_schema.my_table',
});
expect(mockedProps.onTableChange.getCall(0).args[0]).toBe('my_table');
expect(mockedProps.onTableChange.getCall(0).args[1]).toBe('main');
expect(mockedProps.onTableChange.getCall(0).args[1]).toBe('other_schema');
});
});