bitter-lock-96362
04/28/2023, 5:19 PM.wait(). After those tests pass, my UI seems to get stuck in what looks like an in between state. My intuition tells me that this is an issue stemming from the asynchronous .wait(). However, I do have loading skeletons and a spinner that renders while waiting for data, perhaps that is the issue?
The question: Is there a way I can get my UI to update with the stubbed data that I'm missing? I've been digging trough the docs and chatGPT, and It just seems like I have things tied up the way I should. Thanks in advance for any help!
Repo: https://github.com/cameronRomo/GameStack/tree/feature/filter-games
First screenshot shows the problem, second shows app working without stub.
https://cdn.discordapp.com/attachments/1101558392935424072/1101558393354858646/Screen_Shot_2023-04-28_at_11.11.21_AM.png▾
https://cdn.discordapp.com/attachments/1101558392935424072/1101558393677815920/Screen_Shot_2023-04-28_at_11.14.20_AM.png▾
bitter-lock-96362
04/28/2023, 5:27 PMTypeScript, Vite, React and Chakra-UIgray-kilobyte-89541
04/28/2023, 5:31 PMhttps://cdn.discordapp.com/attachments/1101558392935424072/1101561270634807309/Screenshot_2023-04-28_at_13.30.41.png▾
bitter-lock-96362
04/28/2023, 5:37 PMgray-kilobyte-89541
04/28/2023, 5:43 PMbitter-lock-96362
04/28/2023, 5:46 PMnpm i and run it locally. It's currently set up to run on http://localhost:5173/bitter-lock-96362
04/28/2023, 5:49 PMnpm run devgray-kilobyte-89541
04/28/2023, 5:52 PMhttps://cdn.discordapp.com/attachments/1101558392935424072/1101566707534929961/Screenshot_2023-04-28_at_13.52.18.png▾
bitter-lock-96362
04/28/2023, 5:54 PMbitter-lock-96362
04/28/2023, 5:57 PM.env
VITE_RAWG_API_KEY="<your_key>"
and second cypress.env.json
{
"RAWG_API_KEY": "<that_same_key>"
}gray-kilobyte-89541
04/28/2023, 5:59 PMbitter-lock-96362
04/28/2023, 6:03 PMgray-kilobyte-89541
04/28/2023, 6:18 PMbitter-lock-96362
04/28/2023, 6:31 PMbitter-lock-96362
04/28/2023, 6:32 PMgray-kilobyte-89541
04/28/2023, 6:58 PM{
"results": [
{
"id": 1,
"name": "The Witcher 3: Wild Hunt",
"background_image": "https://media.rawg.io/media/crop/600/400/games/618/618c2031a07bbff6b4f611f10b6bcdbc.jpg",
"parent_platforms": [],
"metacritic": "92"
},
{
"id": 2,
"name": "BioShock Infinite",
"background_image": "https://media.rawg.io/media/crop/600/400/games/fc1/fc1307a2774506b5bd65d7e8424664a7.jpg",
"parent_platforms": [],
"metacritic": "94"
}
]
}
even then the platform ids do not match for me, and the background images are not found, so something funky is going on with that api. You can see missing data if right now you pause debugger in this code in useData hook
setLoading(true);
apiClient
.get<FetchResponse<T>>(endpoint, {
signal: controller.signal,
...requestConfig,
})
.then((res) => {
setData(res.data.results);
setLoading(false);
})
.catch((err) => {
if (err instanceof CanceledError) return;
setError(err.message);
setLoading(false);
});bitter-lock-96362
04/28/2023, 8:12 PMbitter-lock-96362
04/28/2023, 8:21 PMcrop/600/400/ from background_image fixed it.
Again, thank you!gray-kilobyte-89541
04/28/2023, 8:34 PM