-
Notifications
You must be signed in to change notification settings - Fork 21
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
Hides jetpack during onboarding if already connected #2516
Merged
joemcgill
merged 9 commits into
feature/2458-streamline-onboarding
from
update/2487-hide-jetpack-if-already-connected-onboarding
Aug 22, 2024
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
64f51bf
Hides jetpack during onboarding if already connected
dsawardekar 88e0799
Limits jetpack check to only the WPComAccount card
dsawardekar ad40c2c
Adds e2e tests for jetpack connected & disconnected states
dsawardekar e2f2420
Refactors variable names in setup flow
dsawardekar f1d84f6
Update e2e tests
joemcgill 7523a05
Fixes linter warnings
dsawardekar 9e606c1
Merge pull request #2521 from woocommerce/update/2487-hide-jetpack-e2…
dsawardekar 223935e
Updates e2e tests per PR feedack & removes unused code
dsawardekar ecd25fc
Updates e2e tests per CR feedback
dsawardekar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -45,7 +45,7 @@ test.describe( 'Set up accounts', () => { | |||||||
await setUpAccountsPage.closePage(); | ||||||||
} ); | ||||||||
|
||||||||
test( 'should see accounts step header, "Connect your WordPress.com account" & connect button', async () => { | ||||||||
test( 'JetpackDisconnected: should see accounts step header, "Connect your WordPress.com account" & connect button', async () => { | ||||||||
await setUpAccountsPage.goto(); | ||||||||
|
||||||||
await expect( | ||||||||
|
@@ -116,7 +116,7 @@ test.describe( 'Set up accounts', () => { | |||||||
} ); | ||||||||
} ); | ||||||||
|
||||||||
test.describe( 'Connect Google account', () => { | ||||||||
test.describe( 'Connected WordPress.com account', async () => { | ||||||||
test.beforeAll( async () => { | ||||||||
// Mock Jetpack as connected | ||||||||
await setUpAccountsPage.mockJetpackConnected( | ||||||||
|
@@ -133,14 +133,44 @@ test.describe( 'Set up accounts', () => { | |||||||
await setUpAccountsPage.goto(); | ||||||||
} ); | ||||||||
|
||||||||
test( 'should see their WPORG email, "Google" title & connect button', async () => { | ||||||||
const jetpackDescriptionRow = | ||||||||
setUpAccountsPage.getJetpackDescriptionRow(); | ||||||||
test( 'should not show the WP.org connection card when already connected', async () => { | ||||||||
await expect( | ||||||||
page.getByRole( 'heading', { name: 'Set up your accounts' } ) | ||||||||
).toBeVisible(); | ||||||||
|
||||||||
await expect( | ||||||||
page.getByText( | ||||||||
'Connect the accounts required to use Google for WooCommerce.' | ||||||||
) | ||||||||
).toBeVisible(); | ||||||||
|
||||||||
await expect( | ||||||||
page.getByRole( 'button', { name: 'Connect' } ).first() | ||||||||
).toBeEnabled(); | ||||||||
eason9487 marked this conversation as resolved.
Show resolved
Hide resolved
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. Let's remove this assertion once the once the previous suggestion is updated.
Suggested change
|
||||||||
|
||||||||
const wpAccountCard = setUpAccountsPage.getWPAccountCard(); | ||||||||
await expect( wpAccountCard ).not.toBeVisible(); | ||||||||
} ); | ||||||||
} ); | ||||||||
|
||||||||
await expect( jetpackDescriptionRow ).toContainText( | ||||||||
test.describe( 'Connect Google account', () => { | ||||||||
test.beforeAll( async () => { | ||||||||
// Mock Jetpack as connected | ||||||||
await setUpAccountsPage.mockJetpackConnected( | ||||||||
'Test user', | ||||||||
'[email protected]' | ||||||||
); | ||||||||
|
||||||||
// Mock google as not connected. | ||||||||
// When pending even WPORG will not render yet. | ||||||||
// If not mocked will fail and render nothing, | ||||||||
// as Jetpack is mocked only on the client-side. | ||||||||
await setUpAccountsPage.mockGoogleNotConnected(); | ||||||||
|
||||||||
await setUpAccountsPage.goto(); | ||||||||
} ); | ||||||||
|
||||||||
test( 'should see their WPORG email, "Google" title & connect button', async () => { | ||||||||
const googleAccountCard = setUpAccountsPage.getGoogleAccountCard(); | ||||||||
|
||||||||
await expect( | ||||||||
|
@@ -393,12 +423,6 @@ test.describe( 'Set up accounts', () => { | |||||||
} ); | ||||||||
|
||||||||
test( 'should see their WPORG email, Google email, "Google Merchant Center" title & "Create account" button', async () => { | ||||||||
const jetpackDescriptionRow = | ||||||||
setUpAccountsPage.getJetpackDescriptionRow(); | ||||||||
await expect( jetpackDescriptionRow ).toContainText( | ||||||||
'[email protected]' | ||||||||
); | ||||||||
|
||||||||
const googleDescriptionRow = | ||||||||
setUpAccountsPage.getGoogleDescriptionRow(); | ||||||||
await expect( googleDescriptionRow ).toContainText( | ||||||||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nice improvement! Thanks!