-
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 #53559 from callstack-internal/fix/mask-missing-fi…
…elds fix: mask fields with sensitive data for Export
- Loading branch information
Showing
2 changed files
with
39 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import type * as OnyxTypes from '@src/types/onyx'; | |
|
||
type ExampleOnyxState = { | ||
session: OnyxTypes.Session; | ||
[key: string]: unknown; | ||
}; | ||
|
||
describe('maskOnyxState', () => { | ||
|
@@ -85,4 +86,17 @@ describe('maskOnyxState', () => { | |
const result = ExportOnyxState.maskOnyxState(input, true) as Record<string, string>; | ||
expect(result.emailString).not.toContain('[email protected]'); | ||
}); | ||
|
||
it('should mask keys that are in the fixed list', () => { | ||
const input = { | ||
session: mockSession, | ||
edits: ['hey', 'hi'], | ||
lastMessageHtml: 'hey', | ||
}; | ||
|
||
const result = ExportOnyxState.maskOnyxState(input, true) as ExampleOnyxState; | ||
|
||
expect(result.edits).toEqual(['***', '***']); | ||
expect(result.lastMessageHtml).toEqual('***'); | ||
}); | ||
}); |