Skip to content

Commit b2f5d49

Browse files
chore: pre pr issues
1 parent 991f3ef commit b2f5d49

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

app/presenters/notifications/setup/download-recipients.presenter.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ function _transformForCsv(recipients) {
6464
'Returns due date': formatDateObjectToISO(recipient.due_date),
6565
'Message type': contact ? 'letter' : 'email',
6666
'Message reference': 'invitations',
67-
'Licence holder': contact ? contactName(recipient.contact) : '',
68-
'Recipient name': '',
6967
Email: recipient.email || '',
68+
'Recipient name': contact ? contactName(recipient.contact) : '',
7069
..._address(contact)
7170
}
7271
})

test/presenters/notifications/setup/download-recipients.presenter.test.js

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ describe('Notifications Setup - Download recipients presenter', () => {
2828

2929
expect(result).to.equal(
3030
// Headers
31-
'"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' +
31+
'"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' +
3232
// Row - Primary user
33-
'"123/46","2434","2018-01-01","2019-01-01","2021-01-01","email","invitations",,,"[email protected]",,,,,,,\n' +
33+
'"123/46","2434","2018-01-01","2019-01-01","2021-01-01","email","invitations","[email protected]",,,,,,,,\n' +
3434
// Row - Licence holder
35-
'"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' +
35+
'"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' +
3636
// Row - Returns to
37-
'"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' +
37+
'"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' +
3838
// Row - Licence holder - organisation
39-
'"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'
39+
'"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'
4040
)
4141
})
4242

@@ -55,9 +55,8 @@ describe('Notifications Setup - Download recipients presenter', () => {
5555
'"Returns due date",' +
5656
'"Message type",' +
5757
'"Message reference",' +
58-
'"Licence holder",' +
59-
'"Recipient name",' +
6058
'"Email",' +
59+
'"Recipient name",' +
6160
'"Address line 1",' +
6261
'"Address line 2",' +
6362
'"Address line 3",' +
@@ -85,9 +84,8 @@ describe('Notifications Setup - Download recipients presenter', () => {
8584
'"2021-01-01",' + // 'Returns due date'
8685
'"email",' + // 'Message type'
8786
'"invitations",' + // 'Message reference'
88-
',' + // 'Licence holder'
89-
',' + // 'Recipient name'
9087
'"[email protected]",' + // Email
88+
',' + // 'Recipient name''
9189
',' + // 'Address line 1'
9290
',' + // 'Address line 2'
9391
',' + // 'Address line 3'
@@ -117,9 +115,8 @@ describe('Notifications Setup - Download recipients presenter', () => {
117115
'"2021-01-01",' + // 'Returns due date'
118116
'"letter",' + // 'Message type'
119117
'"invitations",' + // 'Message reference'
120-
'"Mr J Licence holder only",' + // 'Licence holder'
121-
',' + // 'Recipient name'
122118
',' + // Email
119+
'"Mr J Licence holder only",' + // 'Recipient name''
123120
'"4",' + // 'Address line 1'
124121
'"Privet Drive",' + // 'Address line 2'
125122
'"Line 3",' + // 'Address line 3'
@@ -148,9 +145,8 @@ describe('Notifications Setup - Download recipients presenter', () => {
148145
'"2021-01-01",' + // 'Returns due date'
149146
'"letter",' + // 'Message type'
150147
'"invitations",' + // 'Message reference'
151-
'"Mr J Returns to (same licence ref as licence holder)",' + // 'Licence holder'
152-
',' + // 'Recipient name'
153148
',' + // Email
149+
'"Mr J Returns to (same licence ref as licence holder)",' + // 'Recipient name''
154150
'"4",' + // 'Address line 1'
155151
'"Privet Drive",' + // 'Address line 2'
156152
'"Line 3",' + // 'Address line 3'
@@ -180,9 +176,8 @@ describe('Notifications Setup - Download recipients presenter', () => {
180176
'"2021-01-01",' + // 'Returns due date'
181177
'"letter",' + // 'Message type'
182178
'"invitations",' + // 'Message reference'
183-
'"Gringotts",' + // 'Licence holder' - organisation
184-
',' + // 'Recipient name'
185179
',' + // Email
180+
'"Gringotts",' + // 'Recipient name'' - organisation
186181
'"4",' + // 'Address line 1'
187182
'"Privet Drive",' + // 'Address line 2'
188183
'"Line 3",' + // 'Address line 3'

test/services/notifications/setup/download-recipients.service.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ describe('Notifications Setup - Download recipients service', () => {
4444
expect(result).to.equal({
4545
data:
4646
// Headers
47-
'"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' +
47+
'"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' +
4848
// Row - licence holder
49-
'"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',
49+
'"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',
5050
filename: `Returns invitation - ${referenceCode}.csv`,
5151
type: 'text/csv'
5252
})

0 commit comments

Comments
 (0)