Skip to content

Commit

Permalink
Unit text fix for method formatDateFromRequest (date service). (#297)
Browse files Browse the repository at this point in the history
Date service fix and unit test fix. Check windows URL path fix.
  • Loading branch information
pris54 authored Nov 22, 2017
1 parent 7deb06b commit 618af70
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion admin/controllers/service-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const checkWindowsForm = async (req, res, next) => {
let adminIsDisabled = 0
let checkStartIsDisabled = 0

req.breadcrumbs('Manage check windows', '/administrator/check-windows')
req.breadcrumbs('Manage check windows', '/service-manager/check-windows')
res.locals.pageTitle = actionName + ' check window'
req.breadcrumbs(res.locals.pageTitle)

Expand Down
2 changes: 1 addition & 1 deletion admin/services/date.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const dateService = {
'' + dateItem[keyDay] +
'/' + dateItem[keyMonth] +
'/' + dateItem[keyYear],
'D/MM/YYYY').toDate()
'D/MM/YYYY')
},
/**
* Format check period (start and end dates).
Expand Down
6 changes: 3 additions & 3 deletions admin/spec/service/date.service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ describe('date service', () => {
const result1 = dateService.formatDateFromRequest(requestMock, 'adminStartDay', 'adminStartMonth', 'adminStartYear')
const result2 = dateService.formatDateFromRequest(requestMock, 'checkStartDay', 'checkStartMonth', 'checkStartYear')
const result3 = dateService.formatDateFromRequest(requestMock, 'checkEndDay', 'checkEndMonth', 'checkEndYear')
expect(result1.toString()).toBe('Sat Nov 10 2018 00:00:00 GMT+0000 (UTC)')
expect(result2.toString()).toBe('Sun Dec 09 2018 00:00:00 GMT+0000 (UTC)')
expect(result3.toString()).toBe('Mon Dec 10 2018 00:00:00 GMT+0000 (UTC)')
expect(result1.toString()).toBe('Sat Nov 10 2018 00:00:00 GMT+0000')
expect(result2.toString()).toBe('Sun Dec 09 2018 00:00:00 GMT+0000')
expect(result3.toString()).toBe('Mon Dec 10 2018 00:00:00 GMT+0000')
})
})

Expand Down

0 comments on commit 618af70

Please sign in to comment.