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

Consolidate accounts onboarding: Prevent Google Ads account setup from trying to connect to an unclaimed and disconnected account ID #2688

Merged
merged 5 commits into from
Nov 25, 2024

Conversation

eason9487
Copy link
Member

Changes proposed in this Pull Request:

While doing overall testing with #2682, found an issue that it may try to connect to an unclaimed and disconnected account ID. The test instructions below show the reproduction steps.

Kapture.2024-11-22.at.15.54.37.mp4

It turns out that the account ID used to call API is not the same as the one selected on UI, and it's an unclaimed and disconnected account.

Kapture.2024-11-22.at.15.56.38.mp4

This PR fixes it by resetting the account ID after disconnecting.

const handleDisconnected = () => {
/*
* Prevent the `value` from staying on the unclaimed and disconnected account ID.
* Please note that the reset works because the `AdsAccountSelectControl` happens to
* switch between two different `AppSelectControls` so that `autoSelectFirstOption`
* can be triggered again. Otherwise, it would need to specify `key={ Boolean(value) }`
* in the `<AdsAccountSelectControl>` use of this component.
*/
setValue( undefined );
};

Screenshots:

Kapture.2024-11-22.at.18.14.04.mp4

Detailed test instructions:

  1. Go to step 1 of the onboarding flow
    • Disconnect Google Ads account if there is a connection
    • Have at least one Google Ads account in the existing list
  2. Create a new Google Ads account but don't claim it
  3. Disconnect Google Ads account
  4. Directly connects to the existing Google Ads account currently selected on the UI without any other UI interactions
  5. Check if the account can be connected without errors

…nectExistingAccountActions` within Google Ads Account setup components.
…is disconnected to avoid connecting to an invalid ID.
@eason9487 eason9487 self-assigned this Nov 22, 2024
@github-actions github-actions bot added type: bug The issue is a confirmed bug. changelog: fix Took care of something that wasn't working. labels Nov 22, 2024
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.3%. Comparing base (8d0e378) to head (b8587e6).
Report is 6 commits behind head on feature/2458-2459-2460-2509.

Additional details and impacted files

Impacted file tree graph

@@                       Coverage Diff                        @@
##             feature/2458-2459-2460-2509   #2688      +/-   ##
================================================================
- Coverage                           65.1%   62.3%    -2.8%     
================================================================
  Files                                812     335     -477     
  Lines                              24577    5145   -19432     
  Branches                            1253    1254       +1     
================================================================
- Hits                               15989    3204   -12785     
+ Misses                              8416    1769    -6647     
  Partials                             172     172              
Flag Coverage Δ
js-unit-tests 62.3% <100.0%> (+<0.1%) ⬆️
php-unit-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ents/google-ads-account-card/disconnect-account.js 100.0% <100.0%> (ø)

... and 477 files with indirect coverage changes

---- 🚨 Try these New Features:

@eason9487 eason9487 added changelog: none Skip changelog entry for this PR and removed type: bug The issue is a confirmed bug. changelog: fix Took care of something that wasn't working. labels Nov 22, 2024
@eason9487
Copy link
Member Author

Currently on GitHub Actions, there seems to be some issues with the starting E2E test environment that prevent E2E testing from starting.

@eason9487 eason9487 requested a review from a team November 22, 2024 11:05
Copy link
Contributor

@mikkamp mikkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. I can confirm this is now running as expected.

In combination with the changes in #2690 I'm also able to run the E2E tests locally without any errors.
image

@eason9487 eason9487 merged commit f2c732b into feature/2458-2459-2460-2509 Nov 25, 2024
8 checks passed
@eason9487 eason9487 deleted the fix/connect-to-invalid-ads-id branch November 25, 2024 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: none Skip changelog entry for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants