-
Notifications
You must be signed in to change notification settings - Fork 0
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
361 fix home specs #373
361 fix home specs #373
Conversation
`req.reply()` was not returning an empty response, it was returning the actual response from the server. this led to the "loading" state being present momentarily before the actual response was returned. we are now forcing the loading state to remain, as the mock intends.
made the cypress config file more dynamic. it also will allow us to correctly intercept api calls in our `customApiIntercept` command. update the "featured services list is loading" test check that we in fact have 3 placeholder items, as the description states.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
changed up the specs to fit the flow of the home page. also moving two specs from the browse page to the home page since that's where the requests originate from.
although we were catching the error in `#fetcher`, we weren't returning it as an error. it was being returned to the caller as the `data` value. this means none of our `isError` checks for GET requests were working properly. with this commit, we're throwing the error so that we are handling it on the view correctly.
we're testing for an invalid access token now. the `customApiIntercept` command is also simplified.
also further simplified the `customApiIntercept` function.
@@ -11,6 +11,7 @@ export const fetcher = (url, token) => { | |||
.then(res => res.data) | |||
.catch(error => { | |||
Sentry.captureException(error) | |||
throw error |
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.
without this, we are only getting the placeholder cards on the homepage, instead of the error notice.
if we use return
instead of throw
, then the useSWR hook would incorrectly get the error as the data property:
{
data: <AxiosError...>,
error: undefined
}
Story
fix the 7 home specs locally. they will still fail in ci due to configuration. (ref: #378)
Screenshots / Video
Testing
env
property of "cypress.config.js" set up.yarn cypress:e2e