-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: ensure only public keys passed to 'sendRequestAccountResponseTo…
…Tab'
- Loading branch information
1 parent
ee98fb4
commit c3e9693
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/app/common/actions/send-request-account-response.spec.ts
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,24 @@ | ||
import { sendRequestAccountResponseToTab } from './send-request-account-response'; | ||
import { sendMessageToTab } from '@shared/messages'; | ||
|
||
jest.mock('@shared/messages', () => ({ | ||
sendMessageToTab: jest.fn().mockImplementation(() => null), | ||
})); | ||
|
||
describe(sendRequestAccountResponseToTab.name, () => { | ||
it('must only return to app with public keys', () => { | ||
sendRequestAccountResponseToTab({ | ||
tabId: '2', | ||
id: '1', | ||
account: { | ||
stxPublicKey: 'pubKey1', | ||
dataPublicKey: 'dataKey1', | ||
stxPrivateKey: 'lskdjfjsldf', | ||
} as any, | ||
}); | ||
expect(sendMessageToTab).toHaveBeenCalledTimes(1); | ||
expect(sendMessageToTab).toHaveBeenCalledWith(2, '1', [ | ||
{ dataPublicKey: 'dataKey1', stxPublicKey: 'pubKey1' }, | ||
]); | ||
}); | ||
}); |
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