Skip to content

Commit

Permalink
Add regression test (#367)
Browse files Browse the repository at this point in the history
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
  • Loading branch information
GioSensation authored Aug 11, 2023
1 parent b333fb3 commit 40bcd0d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions integration-test/helpers/mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const constants = {
email: {
personalAddress: `shane-123@duck.com`,
privateAddress0: '0@duck.com',
privateAddress1: '1@duck.com',
selectors: {
identity: '[data-ddg-inputtype="identities.emailAddress"]'
}
Expand Down
15 changes: 13 additions & 2 deletions integration-test/tests/email-autofill.extension.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const test = testContext(base)

test.describe('chrome extension', () => {
test('should autofill the selected email', async ({page}) => {
const {personalAddress, privateAddress0} = constants.fields.email
const {personalAddress, privateAddress0, privateAddress1} = constants.fields.email

forwardConsoleMessages(page)
await withEmailProtectionExtensionSignedInAs(page, stripDuckExtension(personalAddress))
Expand Down Expand Up @@ -52,7 +52,18 @@ test.describe('chrome extension', () => {
// now ensure the second value is the private address
await emailPage.assertEmailValue(privateAddress0)

// autofill a private address again
await emailPage.clickDirectlyOnDax()
await privateAddressBtn.click()

// now check that the field has the new private address
await emailPage.assertEmailValue(privateAddress1)

// assert that the background page received pixel
await emailPage.assertExtensionPixelsCaptured(['autofill_show', 'autofill_personal_address', 'autofill_show', 'autofill_private_address'])
await emailPage.assertExtensionPixelsCaptured([
'autofill_show', 'autofill_personal_address', // personal autofill
'autofill_show', 'autofill_private_address', // first private autofill
'autofill_show', 'autofill_private_address' // second private autofill
])
})
})

0 comments on commit 40bcd0d

Please sign in to comment.