Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 53
issue #4112 Display unique emails in the copy from contact#4267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
5a5be8893514999d72342f5175d907b01864bb8e52eb9c9bb448960aff1b440cdceaa98738aa28623a9d78af5f0072a7377222ca115183c9ecf0f26451e2b1af5b3adFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -23,6 +23,7 @@ import { SetupPageRecipe } from './page-recipe/setup-page-recipe'; | ||
| import { testConstants } from './tooling/consts'; | ||
| import { MsgUtil } from '../core/crypto/pgp/msg-util'; | ||
| import { Buf } from '../core/buf'; | ||
| import { PubkeyInfoWithLastCheck } from '../core/crypto/key'; | ||
| // tslint:disable:no-blank-lines-func | ||
| // tslint:disable:no-unused-expression | ||
| @@ -269,25 +270,41 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te | ||
| })); | ||
| ava.default('compose - settings - manually copied pubkey', testWithBrowser('ci.tests.gmail', async (t, browser) => { | ||
| const dbPage = await browser.newPage(t, TestUrls.extension('chrome/dev/ci_unit_test.htm')); | ||
| // add a contact containing 2 pubkeys to the storage | ||
| await dbPage.page.evaluate(async (pubkeys: string[]) => { | ||
| for (const pubkey of pubkeys) { | ||
| const key = await (window as any).KeyUtil.parse(pubkey); | ||
| await (window as any).ContactStore.update(undefined, 'tocopyfrom@example.test', { pubkey: key }); | ||
| } | ||
| }, [testConstants.abcddfTestComPubkey, testConstants.abcdefTestComPubkey]); | ||
| const inboxPage = await browser.newPage(t, TestUrls.extensionInbox('ci.tests.gmail@flowcrypt.test')); | ||
| let composeFrame = await InboxPageRecipe.openAndGetComposeFrame(inboxPage); | ||
| await ComposePageRecipe.fillMsg(composeFrame, { to: 'human@flowcrypt.com' }, 'just to load - will close this page'); | ||
| await Util.sleep(2); // todo: should wait until actually loaded | ||
| await composeFrame.waitAndClick('@action-close-new-message'); | ||
| await inboxPage.waitTillGone('@container-new-message'); | ||
| composeFrame = await InboxPageRecipe.openAndGetComposeFrame(inboxPage); | ||
| await ComposePageRecipe.fillMsg(composeFrame, { to: 'human+manualcopypgp@flowcrypt.com' }, 'manual copied key'); | ||
| const composeFrame = await InboxPageRecipe.openAndGetComposeFrame(inboxPage); | ||
| await ComposePageRecipe.fillMsg(composeFrame, { to: 'manualcopypgp@flowcrypt.com' }, 'manual copied key'); | ||
| await composeFrame.waitAndClick('@action-open-add-pubkey-dialog', { delay: 1 }); | ||
| await inboxPage.waitAll('@dialog-add-pubkey'); | ||
| const addPubkeyDialog = await inboxPage.getFrame(['add_pubkey.htm']); | ||
| await addPubkeyDialog.waitAll('@input-select-copy-from'); | ||
| await Util.sleep(1); | ||
| await addPubkeyDialog.selectOption('@input-select-copy-from', 'human@flowcrypt.com'); | ||
| await Util.sleep(1); | ||
| await addPubkeyDialog.selectOption('@input-select-copy-from', 'tocopyfrom@example.test'); | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @IvanPizhenko I added filling the contact store source contact with pubkeys
| ||
| await addPubkeyDialog.waitTillGone(['@input-pubkey', '@manual-import-warning']); | ||
| await addPubkeyDialog.selectOption('@input-select-copy-from', 'Copy from Contact'); | ||
| await addPubkeyDialog.waitAll(['@input-pubkey', '@manual-import-warning']); | ||
| await addPubkeyDialog.selectOption('@input-select-copy-from', 'tocopyfrom@example.test'); | ||
| await addPubkeyDialog.waitTillGone(['@input-pubkey', '@manual-import-warning']); | ||
| await addPubkeyDialog.waitAndClick('@action-add-pubkey'); | ||
| await inboxPage.waitTillGone('@dialog-add-pubkey'); | ||
| await composeFrame.waitAndClick('@action-send', { delay: 2 }); | ||
| await inboxPage.waitTillGone('@container-new-message'); | ||
| await inboxPage.close(); | ||
| // test the pubkeys we copied | ||
| const contact = await dbPage.page.evaluate(async () => { | ||
| return await (window as any).ContactStore.getOneWithAllPubkeys(undefined, 'manualcopypgp@flowcrypt.com'); | ||
| }); | ||
| expect(contact.sortedPubkeys.length).to.equal(2); | ||
| expect((contact.sortedPubkeys as PubkeyInfoWithLastCheck[]).map(pub => pub.pubkey.id)).to.include.members( | ||
| ['6CF53D2329C2A80828F499D375AA44AB8930F7E9', '3155F118B6E732B3638A1CE1608BCD797A23FB91']); | ||
| await dbPage.close(); | ||
| })); | ||
| ava.default('compose - keyboard - Ctrl+Enter sends message', testWithBrowser('ci.tests.gmail', async (t, browser) => { | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the first part, all right.
And where is the second part, as specified by Tom's comment?
I suggest to not copy revoked keys,
ContactStore.getEncryptionKeyswould be enough.Also,
<textarea class="pubkey"should be invisible when an email from "Copy From Contact" is selected, as it isn't appropriate for multiple pubkeys (we discussed that we'll no longer useContactStore.gethere)Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rrrooommmaaa Please recheck now