diff --git a/quickstarts/gatsby-build/config.yml b/quickstarts/gatsby-build/config.yml index 148d57df0d..00e00d47a3 100644 --- a/quickstarts/gatsby-build/config.yml +++ b/quickstarts/gatsby-build/config.yml @@ -22,6 +22,5 @@ documentation: description: | Ship performance data from Gatsby builds using OpenTelemetry url: https://newrelic.com/blog/best-practices/optimize-gatsby-build-opentelemetry - dashboards: - gatsby-build diff --git a/utils/__tests__/dashboard-helper.test.js b/utils/__tests__/dashboard-helper.test.js index 96f0744c97..b5bac98a25 100644 --- a/utils/__tests__/dashboard-helper.test.js +++ b/utils/__tests__/dashboard-helper.test.js @@ -66,7 +66,9 @@ describe('dashboard-helper', () => { test('finds warnings across multiple lines', () => { const multiLine = { "accountIds": [ - 12345678 + 12345678, + 3456, + 12, ], } expect(getWarnings(multiLine)).toHaveLength(1); diff --git a/utils/lib/Quickstart.ts b/utils/lib/Quickstart.ts index da61a350db..546f4bf4cc 100644 --- a/utils/lib/Quickstart.ts +++ b/utils/lib/Quickstart.ts @@ -173,7 +173,7 @@ class Quickstart { description: doc.description, })), icon: icon && this._constructIconUrl(icon), - keywords: keywords, + keywords: keywords ?? [], sourceUrl: Component.getAssetSourceUrl( Component.removeBasePath(path.dirname(this.configPath), this.basePath) ), diff --git a/utils/lib/__tests__/Quickstart.test.js b/utils/lib/__tests__/Quickstart.test.js index 18514ff15c..21c856e7ea 100644 --- a/utils/lib/__tests__/Quickstart.test.js +++ b/utils/lib/__tests__/Quickstart.test.js @@ -155,6 +155,16 @@ describe('Quickstart', () => { expect(variables.quickstartMetadata.installPlanStepIds).toHaveLength(1); expect(variables.quickstartMetadata.dataSourceIds).toHaveLength(1); }); + + test('Returns keywords as empty array if no keywords are provided', async () => { + const qs = new Quickstart( + 'quickstarts/mock-quickstart-11/config.yml', + MOCK_FILES_BASEPATH + ); + const variables = await qs.getMutationVariables(true); + + expect(variables.quickstartMetadata.keywords).toEqual([]); + }); }); describe('validate', () => { @@ -187,7 +197,7 @@ describe('Quickstart', () => { test('Returns all quickstarts in directory', () => { const quickstarts = Quickstart.getAll(MOCK_FILES_BASEPATH); - expect(quickstarts).toHaveLength(10); + expect(quickstarts).toHaveLength(11); }); test('Handles no quickstarts in directory', () => { diff --git a/utils/mock_files/quickstarts/mock-quickstart-11/config.yml b/utils/mock_files/quickstarts/mock-quickstart-11/config.yml new file mode 100644 index 0000000000..56fa840563 --- /dev/null +++ b/utils/mock_files/quickstarts/mock-quickstart-11/config.yml @@ -0,0 +1,39 @@ +# Name of the quickstart (required) +slug: template-quickstart + +# Displayed in the UI (required) +title: Template Quickstart + +# Long-form description of the quickstart (required) +description: | + The template quickstart allows you to get visibility into the performance and available of your example service and dependencies. Use this quickstart together with the mock up integrations. + +# Displayed in search results and recommendations. Summarizes a quickstarts functionality. +summary: | + A short form description for this quickstart + +# Support level: New Relic | Verified | Community (required) +level: Community + +# Authors of the quickstart (required) +authors: + - John Smith + +# No keywords + +# Reference to install plans located under /install directory +# Allows us to construct reusable "install plans" and just use their ID in the quickstart config +installPlans: + - mock-install-1 + +dataSourceIds: + - test-data-source + +documentation: + - name: Installation Docs + url: docs.newrelic.com + description: Description about this doc reference + +# Content / Design +icon: logo.png +website: https://www.newrelic.com \ No newline at end of file