-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
ackAcknowledgedAcknowledged
Description
commerce-sdk-isomorphic ships with a neat little test app based on [email protected]
It is challenging to get the app working.
- The app is served over HTTPS, but certificate used with it is self signed and not trusted by browsers. I think it comes from an older version of webpack dev server. To get past browser warnings about this, in Chrome you can type
thisisunsafe. - The default proxy configuration needs to be modified in
package.json, providing a valid shortcode. - The default config in
src/config.jsneeds to be updated with valid values. - The SLAS client you're using needs to be updated to have
https://localhost:3000/callbackbe a valid redirect URI. - Next you'll hit an issue with 404s, because in a browser, the redirect from
authorizewill be followed, and CRA doesn't know how to render/callback:commerce-sdk-isomorphic/src/static/helpers/slasHelper.ts
Lines 140 to 145 in 414ff58
// url is a read only property we unfortunately cannot mock out using nock // meaning redirectUrl will not have a falsy value for unit tests /* istanbul ignore next */ if (response.status >= 400 || searchParams.error) { throw new ResponseError(response); } - Finally, you'll need to make sure the default search query actually load a product, because there seems to be some subtle bug with the text input if no search results are returned.
It is possible to jump through these hoops, but challenging:
A few ideas:
- Consider not running the test app using HTTPS:
commerce-sdk-isomorphic/package.json
Line 39 in 414ff58
"start": "HTTPS=true react-scripts start", - Consider updating the
authorizehelper to be more forgiving. We do care if the initial call toauthorizeCustomerfailed, but in the event that we're running in a browser, we actually do not care if we followed a redirect and the redirect failed to load, as we can still get the usid/code out of the URL, regardless of the status code of loadingredirect_uri. - Commit valid configuration for the test app to this repo. We have public settings that we can use.
- Chase down whatever the zero results bug in the app is!
Metadata
Metadata
Assignees
Labels
ackAcknowledgedAcknowledged
