-
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.
Merge pull request #14484 from Expensify/revert-14455-Rory-PickyRepor…
…tActionsOnyxUpdates Revert "[No QA] Filter out reportActionID-keyed Onyx updates" (cherry picked from commit 40e4baf)
- Loading branch information
1 parent
3496289
commit d699153
Showing
5 changed files
with
8 additions
and
216 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
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
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 |
---|---|---|
|
@@ -18,7 +18,6 @@ import * as PersistedRequests from '../../src/libs/actions/PersistedRequests'; | |
import * as User from '../../src/libs/actions/User'; | ||
import * as ReportUtils from '../../src/libs/ReportUtils'; | ||
import DateUtils from '../../src/libs/DateUtils'; | ||
import * as NumberUtils from '../../src/libs/NumberUtils'; | ||
|
||
jest.mock('../../src/libs/actions/Report', () => { | ||
const originalModule = jest.requireActual('../../src/libs/actions/Report'); | ||
|
@@ -66,16 +65,16 @@ describe('actions/Report', () => { | |
const TEST_USER_ACCOUNT_ID = 1; | ||
const TEST_USER_LOGIN = '[email protected]'; | ||
const REPORT_ID = 1; | ||
const ACTION_ID = 1; | ||
const REPORT_ACTION = { | ||
reportActionID: NumberUtils.rand64(), | ||
actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, | ||
actorAccountID: TEST_USER_ACCOUNT_ID, | ||
actorEmail: TEST_USER_LOGIN, | ||
automatic: false, | ||
avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', | ||
message: [{type: 'COMMENT', html: 'Testing a comment', text: 'Testing a comment'}], | ||
person: [{type: 'TEXT', style: 'strong', text: 'Test User'}], | ||
sequenceNumber: 1, | ||
sequenceNumber: ACTION_ID, | ||
shouldShow: true, | ||
}; | ||
|
||
|
@@ -132,7 +131,7 @@ describe('actions/Report', () => { | |
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, | ||
value: { | ||
[clientID]: null, | ||
1: actionWithoutLoading, | ||
[ACTION_ID]: actionWithoutLoading, | ||
}, | ||
}, | ||
]); | ||
|
@@ -146,7 +145,7 @@ describe('actions/Report', () => { | |
// Verify there is only one action and our optimistic comment has been removed | ||
expect(_.size(reportActions)).toBe(1); | ||
|
||
const resultAction = reportActions[1]; | ||
const resultAction = reportActions[ACTION_ID]; | ||
|
||
// Verify that our action is no longer in the loading state | ||
expect(resultAction.pendingAction).not.toBeDefined(); | ||
|
@@ -355,9 +354,9 @@ describe('actions/Report', () => { | |
onyxMethod: CONST.ONYX.METHOD.MERGE, | ||
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, | ||
value: { | ||
[_.toArray(reportActions)[0].clientID]: null, | ||
[_.toArray(reportActions)[1].clientID]: null, | ||
[_.toArray(reportActions)[2].clientID]: null, | ||
[_.toArray(reportActions)[3].clientID]: null, | ||
2: { | ||
...USER_1_BASE_ACTION, | ||
message: [{type: 'COMMENT', html: 'Current User Comment 1', text: 'Current User Comment 1'}], | ||
|
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