-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Passing AK and Champaign tests, working on specs for process subject …
…access request
- Loading branch information
Showing
10 changed files
with
93 additions
and
46 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
lib/clients/actionkit/resources/__mocks__/akSubjectAccessData.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const AKMockData = { | ||
actions: [{ page_id: 213, member_id: 123 }, { page_id: 234, member_id: 435 }], | ||
}; | ||
|
||
export function AKSubjectAccessData(email) { | ||
console.log('Im in the ak subject access data mock function'); | ||
return Promise.resolve(AKMockData); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export function processSubjectAccessRequest(data, processor, email) { | ||
console.log('mock process subject access request', data); | ||
return Promise.resolve( | ||
`Subject Access Data for ${processor} successfully sent for ${email}` | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function shipToS3(file, bucket) { | ||
return Promise.resolve('www.bogus-url.com'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function zipCSVFiles(dir, filename) { | ||
return Promise.resolve('/path/to/zip/file.zip'); | ||
} |
2 changes: 1 addition & 1 deletion
2
lib/util/basicAuthToken.test.js → lib/util/__tests__/basicAuthToken.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,30 @@ | ||
// test in the process method test file - marshals to csv | ||
// test in the process method test file - uploads a zip file to s3 | ||
// test in the process method test file - emails member services | ||
jest.mock('./shipToS3'); | ||
jest.mock('./zipCSVFiles'); | ||
|
||
import { shipToS3 } from './shipToS3'; | ||
import { zipCSVFiles } from './zipCSVFiles'; | ||
import { processSubjectAccessRequest } from './processSubjectAccessRequest'; | ||
|
||
describe('process subject access requests', function() { | ||
const champaignMockData = { | ||
data: { | ||
actions: [{ id: 213, member_id: 123 }, { id: 234, member_id: 435 }], | ||
}, | ||
}; | ||
|
||
test('marshals json results to csv format', function() { | ||
processSubjectAccessRequest( | ||
champaignMockData, | ||
'champaign', | ||
'foo@example.com' | ||
).then(function(res) { | ||
expect(zipCSVFiles).toHaveBeenCalledWith( | ||
'path', | ||
'foo@example.com-champaign.zip' | ||
); | ||
}); | ||
}); | ||
test('zips the csv files', function() {}); | ||
test('sends the zip file to s3', function() {}); | ||
test('emails member services', function() {}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.