-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update migration tests for new data being removed
- Loading branch information
1 parent
59e0697
commit dbb4cba
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -452,6 +452,56 @@ describe('Migrations', () => { | |
}, | ||
}); | ||
})); | ||
|
||
it('Should remove any instances of ownerEmail found in a report', () => | ||
Onyx.multiSet({ | ||
[`${ONYXKEYS.COLLECTION.REPORT}1`]: { | ||
reportID: 1, | ||
ownerEmail: '[email protected]', | ||
ownerAccountID: 5, | ||
}, | ||
}) | ||
.then(PersonalDetailsByAccountID) | ||
.then(() => { | ||
expect(LogSpy).toHaveBeenCalledWith('[Migrate Onyx] PersonalDetailsByAccountID migration: removing ownerEmail from report 1'); | ||
const connectionID = Onyx.connect({ | ||
key: ONYXKEYS.COLLECTION.REPORT, | ||
waitForCollectionCallback: true, | ||
callback: (allReports) => { | ||
Onyx.disconnect(connectionID); | ||
const expectedReport = { | ||
reportID: 1, | ||
ownerAccountID: 5, | ||
}; | ||
expect(allReports[`${ONYXKEYS.COLLECTION.REPORT}1`]).toMatchObject(expectedReport); | ||
}, | ||
}); | ||
})); | ||
|
||
it('Should remove any instances of managerEmail found in a report', () => | ||
Onyx.multiSet({ | ||
[`${ONYXKEYS.COLLECTION.REPORT}1`]: { | ||
reportID: 1, | ||
managerEmail: '[email protected]', | ||
managerID: 5, | ||
}, | ||
}) | ||
.then(PersonalDetailsByAccountID) | ||
.then(() => { | ||
expect(LogSpy).toHaveBeenCalledWith('[Migrate Onyx] PersonalDetailsByAccountID migration: removing managerEmail from report 1'); | ||
const connectionID = Onyx.connect({ | ||
key: ONYXKEYS.COLLECTION.REPORT, | ||
waitForCollectionCallback: true, | ||
callback: (allReports) => { | ||
Onyx.disconnect(connectionID); | ||
const expectedReport = { | ||
reportID: 1, | ||
managerID: 5, | ||
}; | ||
expect(allReports[`${ONYXKEYS.COLLECTION.REPORT}1`]).toMatchObject(expectedReport); | ||
}, | ||
}); | ||
})); | ||
}); | ||
|
||
describe('CheckForPreviousReportActionID', () => { | ||
|