Skip to content

Commit

Permalink
chore: pre pr issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangoulding committed Feb 6, 2025
1 parent 991f3ef commit b2f5d49
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ function _transformForCsv(recipients) {
'Returns due date': formatDateObjectToISO(recipient.due_date),
'Message type': contact ? 'letter' : 'email',
'Message reference': 'invitations',
'Licence holder': contact ? contactName(recipient.contact) : '',
'Recipient name': '',
Email: recipient.email || '',
'Recipient name': contact ? contactName(recipient.contact) : '',
..._address(contact)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ describe('Notifications Setup - Download recipients presenter', () => {

expect(result).to.equal(
// Headers
'"Licences","Return references","Returns period start date","Returns period end date","Returns due date","Message type","Message reference","Licence holder","Recipient name","Email","Address line 1","Address line 2","Address line 3","Address line 4","Address line 5","Address line 6","Postcode"\n' +
'"Licences","Return references","Returns period start date","Returns period end date","Returns due date","Message type","Message reference","Email","Recipient name","Address line 1","Address line 2","Address line 3","Address line 4","Address line 5","Address line 6","Postcode"\n' +
// Row - Primary user
'"123/46","2434","2018-01-01","2019-01-01","2021-01-01","email","invitations",,,"[email protected]",,,,,,,\n' +
'"123/46","2434","2018-01-01","2019-01-01","2021-01-01","email","invitations","[email protected]",,,,,,,,\n' +
// Row - Licence holder
'"1/343/3","376439279","2018-01-01","2019-01-01","2021-01-01","letter","invitations","Mr J Licence holder only",,,"4","Privet Drive","Line 3","Line 4","Little Whinging","United Kingdom","WD25 7LR"\n' +
'"1/343/3","376439279","2018-01-01","2019-01-01","2021-01-01","letter","invitations",,"Mr J Licence holder only","4","Privet Drive","Line 3","Line 4","Little Whinging","United Kingdom","WD25 7LR"\n' +
// Row - Returns to
'"1/343/3","376439279","2018-01-01","2019-01-01","2021-01-01","letter","invitations","Mr J Returns to (same licence ref as licence holder)",,,"4","Privet Drive","Line 3","Line 4","Surrey","United Kingdom","WD25 7LR"\n' +
'"1/343/3","376439279","2018-01-01","2019-01-01","2021-01-01","letter","invitations",,"Mr J Returns to (same licence ref as licence holder)","4","Privet Drive","Line 3","Line 4","Surrey","United Kingdom","WD25 7LR"\n' +
// Row - Licence holder - organisation
'"1/343/3","376439279","2018-01-01","2019-01-01","2021-01-01","letter","invitations","Gringotts",,,"4","Privet Drive","Line 3","Line 4","Little Whinging","United Kingdom","WD25 7LR"\n'
'"1/343/3","376439279","2018-01-01","2019-01-01","2021-01-01","letter","invitations",,"Gringotts","4","Privet Drive","Line 3","Line 4","Little Whinging","United Kingdom","WD25 7LR"\n'
)
})

Expand All @@ -55,9 +55,8 @@ describe('Notifications Setup - Download recipients presenter', () => {
'"Returns due date",' +
'"Message type",' +
'"Message reference",' +
'"Licence holder",' +
'"Recipient name",' +
'"Email",' +
'"Recipient name",' +
'"Address line 1",' +
'"Address line 2",' +
'"Address line 3",' +
Expand Down Expand Up @@ -85,9 +84,8 @@ describe('Notifications Setup - Download recipients presenter', () => {
'"2021-01-01",' + // 'Returns due date'
'"email",' + // 'Message type'
'"invitations",' + // 'Message reference'
',' + // 'Licence holder'
',' + // 'Recipient name'
'"[email protected]",' + // Email
',' + // 'Recipient name''
',' + // 'Address line 1'
',' + // 'Address line 2'
',' + // 'Address line 3'
Expand Down Expand Up @@ -117,9 +115,8 @@ describe('Notifications Setup - Download recipients presenter', () => {
'"2021-01-01",' + // 'Returns due date'
'"letter",' + // 'Message type'
'"invitations",' + // 'Message reference'
'"Mr J Licence holder only",' + // 'Licence holder'
',' + // 'Recipient name'
',' + // Email
'"Mr J Licence holder only",' + // 'Recipient name''
'"4",' + // 'Address line 1'
'"Privet Drive",' + // 'Address line 2'
'"Line 3",' + // 'Address line 3'
Expand Down Expand Up @@ -148,9 +145,8 @@ describe('Notifications Setup - Download recipients presenter', () => {
'"2021-01-01",' + // 'Returns due date'
'"letter",' + // 'Message type'
'"invitations",' + // 'Message reference'
'"Mr J Returns to (same licence ref as licence holder)",' + // 'Licence holder'
',' + // 'Recipient name'
',' + // Email
'"Mr J Returns to (same licence ref as licence holder)",' + // 'Recipient name''
'"4",' + // 'Address line 1'
'"Privet Drive",' + // 'Address line 2'
'"Line 3",' + // 'Address line 3'
Expand Down Expand Up @@ -180,9 +176,8 @@ describe('Notifications Setup - Download recipients presenter', () => {
'"2021-01-01",' + // 'Returns due date'
'"letter",' + // 'Message type'
'"invitations",' + // 'Message reference'
'"Gringotts",' + // 'Licence holder' - organisation
',' + // 'Recipient name'
',' + // Email
'"Gringotts",' + // 'Recipient name'' - organisation
'"4",' + // 'Address line 1'
'"Privet Drive",' + // 'Address line 2'
'"Line 3",' + // 'Address line 3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ describe('Notifications Setup - Download recipients service', () => {
expect(result).to.equal({
data:
// Headers
'"Licences","Return references","Returns period start date","Returns period end date","Returns due date","Message type","Message reference","Licence holder","Recipient name","Email","Address line 1","Address line 2","Address line 3","Address line 4","Address line 5","Address line 6","Postcode"\n' +
'"Licences","Return references","Returns period start date","Returns period end date","Returns due date","Message type","Message reference","Email","Recipient name","Address line 1","Address line 2","Address line 3","Address line 4","Address line 5","Address line 6","Postcode"\n' +
// Row - licence holder
'"1/343/3","376439279","2018-01-01","2019-01-01","2021-01-01","letter","invitations","Mr J Licence holder only",,,"4","Privet Drive","Line 3","Line 4","Little Whinging","United Kingdom","WD25 7LR"\n',
'"1/343/3","376439279","2018-01-01","2019-01-01","2021-01-01","letter","invitations",,"Mr J Licence holder only","4","Privet Drive","Line 3","Line 4","Little Whinging","United Kingdom","WD25 7LR"\n',
filename: `Returns invitation - ${referenceCode}.csv`,
type: 'text/csv'
})
Expand Down

0 comments on commit b2f5d49

Please sign in to comment.