Skip to content

Commit

Permalink
fix: pr
Browse files Browse the repository at this point in the history
alpha sort

white spaces

content
  • Loading branch information
jonathangoulding committed May 3, 2024
1 parent 5513d07 commit aa2092c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/controllers/licences.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ async function viewReturns (request, h) {
module.exports = {
noReturnsRequired,
returnsRequired,
viewSummary,
viewReturns
viewReturns,
viewSummary
}
5 changes: 3 additions & 2 deletions app/presenters/licences/view-licence-returns.presenter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

/**
* Formats data for common licence data `/licences/{id}` page's
* Formats common data for the `/licences/{id}/*` view licence pages
* @module ViewLicenceReturnsPresenter
*/

Expand All @@ -24,6 +24,7 @@ function go (returnsData) {

function _formatPurpose (purpose) {
const [firstPurpose] = purpose

return firstPurpose.alias ? firstPurpose.alias : firstPurpose.tertiary.description
}

Expand All @@ -34,7 +35,7 @@ function _formatStatus (status) {
}

function _formatReturnToTableRow (returns) {
return returns.map(r => {
return returns.map((r) => {
return {
id: r.id,
reference: r.returnReference,
Expand Down
4 changes: 2 additions & 2 deletions app/routes/licence.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ const routes = [
path: '/licences/{id}/summary',
handler: LicencesController.viewSummary,
options: {
description: 'View a summary licence page'
description: 'View a licence summary page'
}
},
{
method: 'GET',
path: '/licences/{id}/returns',
handler: LicencesController.viewReturns,
options: {
description: 'View a returns licence page'
description: 'View a licence returns page'
}
},
{
Expand Down
1 change: 1 addition & 0 deletions app/services/licences/view-licence-returns.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const FetchLicenceReturnsService = require('./fetch-licence-returns.service')
const ViewLicenceService = require('./view-licence.service')
const ViewLicenceReturnsPresenter = require('../../presenters/licences/view-licence-returns.presenter')
const PaginatorPresenter = require('../../presenters/paginator.presenter')

/**
* Orchestrates fetching and presenting the data needed for the licence summary page
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Fetch licence returns service', () => {
await DatabaseSupport.clean()
})

describe('when there is no optional data in the model', () => {
describe('when the licence has return logs', () => {
let firstReturn
let latestReturn
const dueDate = new Date('2020-04-01')
Expand Down
2 changes: 2 additions & 0 deletions test/services/licences/view-licence-returns.service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ViewLicenceService = require('../../../app/services/licences/view-licence.
const PaginatorPresenter = require('../../../app/presenters/paginator.presenter')
const ViewLicenceReturnsPresenter = require('../../../app/presenters/licences/view-licence-returns.presenter')
const FetchLicenceReturnsService = require('../../../app/services/licences/fetch-licence-returns.service')

// Thing under test
const ViewLicenceReturnsService = require('../../../app/services/licences/view-licence-returns.service')

Expand All @@ -21,6 +22,7 @@ describe('View Licence service returns', () => {
const page = 1
const auth = {}
const pagination = { page }

beforeEach(() => {
Sinon.stub(FetchLicenceReturnsService, 'go').resolves(_returnsFetch())
Sinon.stub(PaginatorPresenter, 'go').returns(pagination)
Expand Down

0 comments on commit aa2092c

Please sign in to comment.