diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cecb5440..9137cd78 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - REPOSITORY: flood_map_planning/app-internal + REPOSITORY: flood_map_planning/app jobs: build: diff --git a/server/routes/__tests__/about.spec.js b/server/routes/__tests__/about.spec.js new file mode 100644 index 00000000..202f1eb8 --- /dev/null +++ b/server/routes/__tests__/about.spec.js @@ -0,0 +1,15 @@ +jest.mock('../../services/external-health-check') +const { submitGetRequest } = require('../../__test-helpers__/server') +const { assertCopy } = require('../../__test-helpers__/copy') +const url = '/about' + +describe('About Page', () => { + it('/about page should contain version numbers as expected', async () => { + await submitGetRequest({ url }, 'Flood map for planning') + assertCopy('#fmp-app-version', 'Version: v3.0.0-1') + assertCopy('#fmp-app-revision', 'Revision: 9256171') + assertCopy('#fmp-app-type', 'internal') + assertCopy('#fmp-api-version', 'Version: v8.8.8') + assertCopy('#fmp-api-revision', 'Revision: 9988776') + }) +}) diff --git a/server/routes/about.js b/server/routes/about.js index 99b4f675..edc11015 100644 --- a/server/routes/about.js +++ b/server/routes/about.js @@ -1,3 +1,4 @@ +const { config } = require('../../config') const { version, revision } = require('../../version') const externalHealthCheck = require('../services/external-health-check') @@ -14,7 +15,8 @@ module.exports = { const data = { fmpApp: { version: version.substring(0, version.lastIndexOf('-')), - revision: revision.substring(0, GIT_REVISION_LENGTH) + revision: revision.substring(0, GIT_REVISION_LENGTH), + appType: config.appType }, fmpApi } diff --git a/server/services/__mocks__/external-health-check.js b/server/services/__mocks__/external-health-check.js new file mode 100644 index 00000000..0571cedd --- /dev/null +++ b/server/services/__mocks__/external-health-check.js @@ -0,0 +1,3 @@ +const getFmpApiVersion = async () => ({ version: 'v8.8.8', revision: '998877665544332211' }) + +module.exports = { getFmpApiVersion } diff --git a/server/views/about.html b/server/views/about.html index c3d0df4a..193ae3ea 100644 --- a/server/views/about.html +++ b/server/views/about.html @@ -13,6 +13,7 @@