-
Notifications
You must be signed in to change notification settings - Fork 284
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
Implement the unhappy paths for the Audience Creation Notice #8166
Comments
I've moved this back to Backlog as the final in-progress changes to the design doc, relating to audience caching, will probably affect the AC for this one |
The audience caching aspect of the design doc has been sufficiently finalised, and I've moved this back to AC. |
Hi @hussain-t, thanks for drafting this IB. The production code side looks good. My only hesitation is that the amount of testing looks a bit excessive. It suggests we'll effectively be providing stories and tests that cover the same thing multiple times - the |
Thanks, @techanvil. I've updated the test coverage as suggested. However, retaining the |
Thanks @hussain-t. Agreed, keeping the IB ✅ |
@techanvil Temporarily co-assigning this to you for visibility as I have a question regarding the ACs in the PR here. Thanks! CC: @hussain-t |
Feature Description
Implement the unhappy paths for creating an audience via the Audience Creation Notice. This does include showing an error from the OAuth flow.
See audience creation > error states and OAuth errors in the design doc.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Create the
AudienceCreationErrorNotice
component inassets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel
:apiErrors
andhasOAuthError
as props. It doesn't need other props from theAudienceErrorModal
component as it will be scoped to theAudienceCreationNotice
component.Update the
AudienceCreationNotice
component inassets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceCreationNotice.js
:{ error }
object returned from thecreateAudience
action within thehandleCreateAudience
callback function in the component state.getSetupErrorCode
selector of theCORE_SITE
store.hasOAuthError
that checks ifautoSubmit
is true and the setup error code equals'access_denied'
.AudienceCreationErrorNotice
component with the appropriate props.Test Coverage
AudienceCreationErrorNotice
component to cover the error variants.AudienceSelectionPanel
component to cover the possible error variants.AudienceSelectionPanel
component to cover the error variants.QA Brief
Prerequisites
wp_googlesitekit_additional_auth_scopes
entry from thewp_usermeta
table if it exists. This entry contains thehttps://www.googleapis.com/auth/analytics.edit
scope.new-visitors
andreturning-visitors
audiences in the Analytics console.create-audience
request in the network tab and copy the request payload. Use this payload in the Tweak extension to simulate the errors. Ensure the Tweak extension is disabled to make a successful request.Testing the Error Notice Variants
There are three Error Notice variants to test:
OAuth Error Variant
To simulate the OAuth error variant:
Prepare the Environment:
wp_googlesitekit_additional_auth_scopes
entry from thewp_usermeta
table if it exists. This entry contains thehttps://www.googleapis.com/auth/analytics.edit
scope.Trigger the OAuth Error:
Insufficient Permissions Error Variant
To simulate the Insufficient Permissions error variant:
create-audience
request:.*/wp-json/google-site-kit/v1/modules/analytics-4/data/create-audience*
(.*)
POST
403
Generic Error Variant
To simulate the Generic Error variant:
API Errors:
create-audience
request:.*/wp-json/google-site-kit/v1/modules/analytics-4/data/create-audience*
(.*)
POST
500
Changelog entry
The text was updated successfully, but these errors were encountered: