diff --git a/packages/api-explorer/src/components/ExploreType/ExploreProperty.spec.tsx b/packages/api-explorer/src/components/ExploreType/ExploreProperty.spec.tsx index bf84d3b64..1147d6420 100644 --- a/packages/api-explorer/src/components/ExploreType/ExploreProperty.spec.tsx +++ b/packages/api-explorer/src/components/ExploreType/ExploreProperty.spec.tsx @@ -35,12 +35,15 @@ import { ExploreProperty, ExplorePropertyDetail, typeIcon } from '.' describe('ExploreProperty', () => { const type = api.types.CreateDashboardFilter + describe('ExplorePropertyDetail', () => { describe('CreateDashboardFilter', () => { test('Shows read-only property and description', async () => { const property = type.properties.id expect(property).toBeDefined() - renderWithSearchAndRouter() + renderWithSearchAndRouter( + + ) expect(property.deprecated).toEqual(false) expect(property.readOnly).toEqual(true) // eslint-disable-next-line jest-dom/prefer-required @@ -54,10 +57,13 @@ describe('ExploreProperty', () => { ) }) }) + test('Shows required property and description', async () => { const property = type.properties.dashboard_id expect(property).toBeDefined() - renderWithSearchAndRouter() + renderWithSearchAndRouter( + + ) expect(property.deprecated).toEqual(false) expect(property.readOnly).toEqual(false) // eslint-disable-next-line jest-dom/prefer-required @@ -78,23 +84,31 @@ describe('ExploreProperty', () => { test('int64 property icon is correct', () => { const property = type.properties.row expect(property.type.jsonName).toEqual('int64') - renderWithSearchAndRouter() + renderWithSearchAndRouter( + + ) expect(screen.getByTitle('int64')).toBeInTheDocument() const legend = typeIcon(property.type) expect(legend).toEqual({ icon: , title: 'int64' }) }) + test('array property icon is correct', () => { const property = type.properties.listens_to_filters expect(property.type.jsonName).toEqual('string[]') - renderWithSearchAndRouter() + renderWithSearchAndRouter( + + ) expect(screen.getByTitle(property.type.jsonName)).toBeInTheDocument() const legend = typeIcon(property.type) expect(legend).toEqual({ icon: , title: 'string[]' }) }) + test('hash property icon is correct', () => { const property = type.properties.field expect(property.type.jsonName).toEqual('Hash[any]') - renderWithSearchAndRouter() + renderWithSearchAndRouter( + + ) expect(screen.getByTitle(property.type.jsonName)).toBeInTheDocument() const legend = typeIcon(property.type) expect(legend).toEqual({ icon: , title: 'Hash[any]' }) diff --git a/packages/api-explorer/src/scenes/MethodScene/components/DocRequestBody.spec.tsx b/packages/api-explorer/src/scenes/MethodScene/components/DocRequestBody.spec.tsx index e8e5add0e..bfc3ba616 100644 --- a/packages/api-explorer/src/scenes/MethodScene/components/DocRequestBody.spec.tsx +++ b/packages/api-explorer/src/scenes/MethodScene/components/DocRequestBody.spec.tsx @@ -34,7 +34,7 @@ import { DocRequestBody } from './DocRequestBody' describe('DocRequestBody', () => { test('it shows Request body for a method with a body type', () => { const method = api.methods.create_dashboard - renderWithTheme() + renderWithTheme() expect( screen.getByText('Request body', { exact: false }) ).toBeInTheDocument() @@ -42,7 +42,7 @@ describe('DocRequestBody', () => { test('it skips Request body for a method without a body type', () => { const method = api.methods.dashboard - renderWithTheme() + renderWithTheme() expect( screen.queryByText('Request body', { exact: false }) ).not.toBeInTheDocument() diff --git a/packages/extension-api-explorer/bin/deploy b/packages/extension-api-explorer/bin/deploy index f933345ca..039b0166e 100755 --- a/packages/extension-api-explorer/bin/deploy +++ b/packages/extension-api-explorer/bin/deploy @@ -1,4 +1,10 @@ #!/bin/bash +set -e + +# keep track of the last executed command +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +# echo an error message before exiting +trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT if [ $# -eq 0 ] then @@ -12,8 +18,12 @@ cd ../.. && yarn echo "Rebuilding all packages" yarn build + +cd packages/extension-api-explorer +echo "Removing existing bundle" +rm -rf dist/ echo "Creating extension-api-explorer production bundle" -cd packages/extension-api-explorer && yarn bundle +yarn bundle path_to_bundle=$(pwd)"/dist/bundle.js" cd ../../.. diff --git a/packages/extension-sdk/src/connect/extension_host_api.spec.ts b/packages/extension-sdk/src/connect/extension_host_api.spec.ts index 5ee4dd21b..a4f8aa308 100644 --- a/packages/extension-sdk/src/connect/extension_host_api.spec.ts +++ b/packages/extension-sdk/src/connect/extension_host_api.spec.ts @@ -420,7 +420,7 @@ describe('extension_host_api tests', () => { }), }) throw new Error('Unexpected success') - } catch (error) { + } catch (error: any) { expect(error.message).toEqual( 'Extension requires Looker version >=7.9, got 6.25.0' ) @@ -511,7 +511,7 @@ describe('extension_host_api tests', () => { }), }) throw new Error('Unexpected success') - } catch (error) { + } catch (error: any) { expect(error.message).toEqual( 'Extension requires Looker version >=7.11, got 6.25.0' ) @@ -562,7 +562,7 @@ describe('extension_host_api tests', () => { } await hostApi.oauth2Authenticate(authEndpoint, authParameters) throw new Error('Unexpected success') - } catch (error) { + } catch (error: any) { expect(error.message).toEqual( 'Extension requires Looker version >=7.9, got 6.25.0' ) @@ -626,7 +626,7 @@ describe('extension_host_api tests', () => { exchangeParameters ) throw new Error('Unexpected success') - } catch (error) { + } catch (error: any) { expect(error.message).toEqual( 'Extension requires Looker version >=7.11, got 7.9' ) @@ -660,7 +660,7 @@ describe('extension_host_api tests', () => { try { hostApi.createSecretKeyTag('SECRET_KEY_NAME') throw new Error('Unexpected success') - } catch (error) { + } catch (error: any) { expect(error.message).toEqual( 'Extension requires Looker version >=7.11, got 7.9' ) @@ -682,7 +682,7 @@ describe('extension_host_api tests', () => { try { hostApi.createSecretKeyTag('SECRET_KEY_NAME_@@') throw new Error('Unexpected success') - } catch (error) { + } catch (error: any) { expect(error.message).toEqual('Unsupported characters in key name') } })