michael-s-molina commented on a change in pull request #15117:
URL: https://github.com/apache/superset/pull/15117#discussion_r650916244
##########
File path:
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.test.tsx
##########
@@ -94,3 +107,23 @@ test('Should call "getClientErrorObject" when api returns
an error', async () =>
expect(spy).toBeCalled();
});
});
+
+test('Should filter results', async () => {
+ const props = createProps({
+ filterValues: (column: Column) => column.is_dttm,
+ });
+ const { container } = render(<ColumnSelect {...(props as any)} />, {
+ useRedux: true,
+ });
+ expect(container.children).toHaveLength(1);
+ userEvent.type(screen.getByRole('combobox'), 'column_name');
+ await waitFor(() => {
Review comment:
Same as previous comment
##########
File path:
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.test.tsx
##########
@@ -37,34 +39,45 @@ fetchMock.get('http://localhost/api/v1/dataset/456', {
body: {
result: {
columns: [
- { column_name: 'column_name_04' },
- { column_name: 'column_name_05' },
- { column_name: 'column_name_06' },
+ { column_name: 'column_name_04', is_dttm: false },
+ { column_name: 'column_name_05', is_dttm: false },
+ { column_name: 'column_name_06', is_dttm: false },
],
},
},
});
fetchMock.get('http://localhost/api/v1/dataset/789', { status: 404 });
-const createProps = () => ({
+const createProps = (extraProps: JsonObject = {}) => ({
filterId: 'filterId',
form: { getFieldValue: jest.fn(), setFields: jest.fn() },
datasetId: 123,
value: 'column_name_01',
onChange: jest.fn(),
+ ...extraProps,
});
afterAll(() => {
fetchMock.restore();
});
-test('Should render', () => {
+test('Should render', async () => {
const props = createProps();
const { container } = render(<ColumnSelect {...(props as any)} />, {
useRedux: true,
});
expect(container.children).toHaveLength(1);
+ userEvent.type(screen.getByRole('combobox'), 'column_name');
+ await waitFor(() => {
Review comment:
You can join them all in one `waitFor`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]