diff --git a/docs/docs/contributing/development.mdx b/docs/docs/contributing/development.mdx index 56ff00153..fc30301c9 100644 --- a/docs/docs/contributing/development.mdx +++ b/docs/docs/contributing/development.mdx @@ -89,6 +89,17 @@ For more env vars that affect your configuration, see this [superset_config.py](https://github.com/apache/superset/blob/master/docker/pythonpath_dev/superset_config.py) used in the `docker compose` context to assign env vars to the superset configuration. +### Accessing the postgres database +Sometimes it's useful to access the database in the docker container directly. +You can enter a `psql` shell (the official Postgres client) by running the following command: + +```bash +docker compose exec db psql -U superset +``` + +Also note that the database is exposed on port 5432, so you can connect to it using your favorite +Postgres client or even SQL Lab itselft directly in Superset by creating a new database connection +to `localhost:5432`. ### Nuking the postgres database diff --git a/superset-frontend/src/features/home/EmptyState.test.tsx b/superset-frontend/src/features/home/EmptyState.test.tsx index 7506b3d0f..fe633bc78 100644 --- a/superset-frontend/src/features/home/EmptyState.test.tsx +++ b/superset-frontend/src/features/home/EmptyState.test.tsx @@ -62,11 +62,14 @@ describe('EmptyState', () => { tableName: WelcomeTable.Recents, }, ]; + variants.forEach(variant => { - it(`it renders an ${variant.tab} ${variant.tableName} empty state`, () => { + it(`renders an ${variant.tab} ${variant.tableName} empty state`, () => { const wrapper = mount(); expect(wrapper).toExist(); - const textContainer = wrapper.find('.ant-empty-description'); + + // Select the first description node + const textContainer = wrapper.find('.ant-empty-description').at(0); expect(textContainer.text()).toEqual( variant.tab === TableTab.Favorite ? "You don't have any favorites yet!" @@ -79,12 +82,19 @@ describe('EmptyState', () => { expect(wrapper.find('button')).toHaveLength(1); }); }); + recents.forEach(recent => { - it(`it renders a ${recent.tab} ${recent.tableName} empty state`, () => { + it(`renders a ${recent.tab} ${recent.tableName} empty state`, () => { const wrapper = mount(); expect(wrapper).toExist(); - const textContainer = wrapper.find('.ant-empty-description'); + + // Select the first description node + const textContainer = wrapper.find('.ant-empty-description').at(0); + + // Validate the image expect(wrapper.find('.ant-empty-image').children()).toHaveLength(1); + + // Check the correct text is displayed expect(textContainer.text()).toContain( `Recently ${recent.tab?.toLowerCase()} charts, dashboards, and saved queries will appear here`, );