Skip to content

Commit

Permalink
Test contacts syncing initial state too, not just actions
Browse files Browse the repository at this point in the history
Tests for 296f5e6 (#1735).
  • Loading branch information
lukaw3d committed Oct 20, 2023
1 parent b05c379 commit 4fc4fb8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions playwright/tests/syncTabs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,30 @@ test.describe('syncTabs', () => {
await page.getByTestId('toolbar-contacts-tab').click()
await page.getByText('You have no contacts yet.')

await page.getByRole('button', { name: 'Add Contact' }).click()
await page.getByPlaceholder('Name').fill('stakefish')
await page
.getByPlaceholder('Address', { exact: true })
.fill('oasis1qq3xrq0urs8qcffhvmhfhz4p0mu7ewc8rscnlwxe')
await page.getByRole('button', { name: 'Save' }).click()
await expect(page.getByTestId('account-choice')).toHaveCount(1)

await tab2.goto('/')
await tab2.getByTestId('account-selector').click()
await tab2.getByTestId('toolbar-contacts-tab').click()
await expect(tab2.getByTestId('account-choice')).toHaveCount(1)
await tab2.getByRole('button', { name: 'Add Contact' }).click()
await tab2.getByPlaceholder('Name').fill('Foo')
await tab2
.getByPlaceholder('Address', { exact: true })
.fill('oasis1qq2vzcvxn0js5unsch5me2xz4kr43vcasv0d5eq4')
await tab2.getByRole('button', { name: 'Save' }).click()
await expect(tab2.getByTestId('account-choice')).toHaveCount(1)
await expect(page.getByTestId('account-choice')).toHaveCount(1)
await expect(tab2.getByTestId('account-choice')).toHaveCount(2)
await expect(page.getByTestId('account-choice')).toHaveCount(2)

await page.getByRole('button', { name: 'Manage' }).first().click()
await page.getByRole('button', { name: 'Delete contact' }).click()
await page.getByRole('button', { name: 'Yes, delete' }).click()

await page.getByRole('button', { name: 'Manage' }).click()
await page.getByPlaceholder('Name').fill('Bar')
Expand Down

0 comments on commit 4fc4fb8

Please sign in to comment.