Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(safari): remove autocomplete in table select #23361

Merged
merged 3 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update tests
  • Loading branch information
villebro committed Mar 14, 2023
commit 5224439606acb81c44b1f717fbe9126c6bca5922
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ test('table should be visible when expanded is true', async () => {
const { container } = await renderAndWait(mockedProps, store);

const dbSelect = screen.getByRole('combobox', {
name: 'Select database or type database name',
name: 'Select database or type to search databases',
});
const schemaSelect = screen.getByRole('combobox', {
name: 'Select schema or type schema name',
name: 'Select schema or type to search schemas',
});
const dropdown = screen.getByText(/Table/i);
const abUser = screen.queryAllByText(/ab_user/i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ test('Refresh should work', async () => {
expect(fetchMock.calls(schemaApiRoute).length).toBe(0);

const select = screen.getByRole('combobox', {
name: 'Select schema or type schema name',
name: 'Select schema or type to search schemas',
});

userEvent.click(select);
Expand Down Expand Up @@ -215,7 +215,7 @@ test('Should database select display options', async () => {
const props = createProps();
render(<DatabaseSelector {...props} />, { useRedux: true });
const select = screen.getByRole('combobox', {
name: 'Select database or type database name',
name: 'Select database or type to search databases',
});
expect(select).toBeInTheDocument();
userEvent.click(select);
Expand All @@ -237,7 +237,7 @@ test('should show empty state if there are no options', async () => {
{ useRedux: true },
);
const select = screen.getByRole('combobox', {
name: 'Select database or type database name',
name: 'Select database or type to search databases',
});
userEvent.click(select);
const emptystate = await screen.findByText('empty');
Expand All @@ -249,7 +249,7 @@ test('Should schema select display options', async () => {
const props = createProps();
render(<DatabaseSelector {...props} />, { useRedux: true });
const select = screen.getByRole('combobox', {
name: 'Select schema or type schema name',
name: 'Select schema or type to search schemas',
});
expect(select).toBeInTheDocument();
userEvent.click(select);
Expand All @@ -265,7 +265,7 @@ test('Sends the correct db when changing the database', async () => {
const props = createProps();
render(<DatabaseSelector {...props} />, { useRedux: true });
const select = screen.getByRole('combobox', {
name: 'Select database or type database name',
name: 'Select database or type to search databases',
});
expect(select).toBeInTheDocument();
userEvent.click(select);
Expand All @@ -285,7 +285,7 @@ test('Sends the correct schema when changing the schema', async () => {
const props = createProps();
render(<DatabaseSelector {...props} />, { useRedux: true });
const select = screen.getByRole('combobox', {
name: 'Select schema or type schema name',
name: 'Select schema or type to search schemas',
});
expect(select).toBeInTheDocument();
userEvent.click(select);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ test('renders with default props', async () => {
const props = createProps();
render(<TableSelector {...props} />, { useRedux: true });
const databaseSelect = screen.getByRole('combobox', {
name: 'Select database or type database name',
name: 'Select database or type to search databases',
});
const schemaSelect = screen.getByRole('combobox', {
name: 'Select schema or type schema name',
name: 'Select schema or type to search schemas',
});
const tableSelect = screen.getByRole('combobox', {
name: 'Select table or type table name',
name: 'Select table or type to search tables',
});
await waitFor(() => {
expect(databaseSelect).toBeInTheDocument();
Expand All @@ -99,7 +99,7 @@ test('renders table options', async () => {
const props = createProps();
render(<TableSelector {...props} />, { useRedux: true });
const tableSelect = screen.getByRole('combobox', {
name: 'Select table or type table name',
name: 'Select table or type to search tables',
});
userEvent.click(tableSelect);
expect(
Expand All @@ -117,7 +117,7 @@ test('renders disabled without schema', async () => {
const props = createProps();
render(<TableSelector {...props} schema={undefined} />, { useRedux: true });
const tableSelect = screen.getByRole('combobox', {
name: 'Select table or type table name',
name: 'Select table or type to search tables',
});
await waitFor(() => {
expect(tableSelect).toBeDisabled();
Expand All @@ -135,7 +135,7 @@ test('table options are notified after schema selection', async () => {
render(<TableSelector {...props} />, { useRedux: true });

const schemaSelect = screen.getByRole('combobox', {
name: 'Select schema or type schema name',
name: 'Select schema or type to search schemas',
});
expect(schemaSelect).toBeInTheDocument();
expect(callback).not.toHaveBeenCalled();
Expand Down Expand Up @@ -178,7 +178,7 @@ test('table select retain value if not in SQL Lab mode', async () => {
render(<TableSelector {...props} />, { useRedux: true });

const tableSelect = screen.getByRole('combobox', {
name: 'Select table or type table name',
name: 'Select table or type to search tables',
});

expect(screen.queryByText('table_a')).not.toBeInTheDocument();
Expand Down Expand Up @@ -218,7 +218,7 @@ test('table multi select retain all the values selected', async () => {
render(<TableSelectorMultiple {...props} />, { useRedux: true });

const tableSelect = screen.getByRole('combobox', {
name: 'Select table or type table name',
name: 'Select table or type to search tables',
});

expect(screen.queryByText('table_a')).not.toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ test('should render schema selector, database selector container, and selects',
expect(await screen.findByText(/select database & schema/i)).toBeVisible();

const databaseSelect = screen.getByRole('combobox', {
name: 'Select database or type database name',
name: 'Select database or type to search databases',
});
const schemaSelect = screen.getByRole('combobox', {
name: 'Select schema or type schema name',
name: 'Select schema or type to search schemas',
});
expect(databaseSelect).toBeInTheDocument();
expect(schemaSelect).toBeInTheDocument();
Expand All @@ -188,7 +188,7 @@ test('renders list of options when user clicks on schema', async () => {

// Click 'test-postgres' database to access schemas
const databaseSelect = screen.getByRole('combobox', {
name: 'Select database or type database name',
name: 'Select database or type to search databases',
});
userEvent.click(databaseSelect);
expect(await screen.findByText('test-postgres')).toBeInTheDocument();
Expand Down