Skip to content
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

Add regression test #367

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
])
})
})
Loading