Skip to content

Commit

Permalink
FCRM-5547 Change the AWS repo that fmp-app deploys to (#459)
Browse files Browse the repository at this point in the history
* FCRM-5547 workflows/docker.yml now pushes to flood_map_planning/app

* FCRM-5547 added appType to the about page

* FCRM-5547 added unit tests for about.js
  • Loading branch information
markfee authored Jan 27, 2025
1 parent 2a5def7 commit 4a9ebe2
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

env:
REPOSITORY: flood_map_planning/app-internal
REPOSITORY: flood_map_planning/app

jobs:
build:
Expand Down
15 changes: 15 additions & 0 deletions server/routes/__tests__/about.spec.js
Original file line number Diff line number Diff line change
@@ -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')
})
})
4 changes: 3 additions & 1 deletion server/routes/about.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { config } = require('../../config')
const { version, revision } = require('../../version')
const externalHealthCheck = require('../services/external-health-check')

Expand All @@ -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
}
Expand Down
3 changes: 3 additions & 0 deletions server/services/__mocks__/external-health-check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const getFmpApiVersion = async () => ({ version: 'v8.8.8', revision: '998877665544332211' })

module.exports = { getFmpApiVersion }
1 change: 1 addition & 0 deletions server/views/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ <h1 class="govuk-heading-l" tabindex="0">Flood map for planning</h1>
<li class="govuk-heading-m">Application</li>
<li id='fmp-app-version' class="govuk-body govuk-!-padding-left-5">Version: {{fmpApp.version}}</li>
<li id='fmp-app-revision' class="govuk-body govuk-!-padding-left-5">Revision: {{fmpApp.revision}}</li>
<li id='fmp-app-type' class="govuk-body govuk-!-padding-left-5">Type: {{fmpApp.appType}}</li>
<li class="govuk-heading-m">API</li>
<li id='fmp-api-version' class="govuk-body govuk-!-padding-left-5">Version: {{fmpApi.version}}</li>
<li id='fmp-api-revision' class="govuk-body govuk-!-padding-left-5">Revision: {{fmpApi.revision}}</li>
Expand Down
45 changes: 0 additions & 45 deletions test/routes/about.js

This file was deleted.

0 comments on commit 4a9ebe2

Please sign in to comment.