cuttle-cards / cuttle

A two-player battle card game for all ages, built with nodejs, sailsjs, and vuejs
MIT License
145 stars 115 forks source link

Feat/game list on socket reconnect #1074

Open Mang0codes opened 1 month ago

Mang0codes commented 1 month ago

Issue number

Relevant issue number

Please check the following

Please describe additional details for testing this change

Changes Made: Updated src/plugins/sockets/connectivityEvents.js to handle the case when the route is ROUTE_NAME_HOME. If the user is on the homepage when the socket reconnects, the gameListStore.requestGameList() method is called to retrieve the most recent list of available games. Imported and instantiated the gameListStore in connectivityEvents.js to make this functionality available.

Haviles04 commented 1 month ago

Nice work! This looks good

As far as the failing test it looks like the test will need a little bit of a re-work as well, considering we're looking for a outdated gameList that is (now) refreshed and hiding closed games upon reconnection of the socket

If you have any questions you can reach out in the #code channel on our Discord

Mang0codes commented 1 month ago

Nice work! This looks good

As far as the failing test it looks like the test will need a little bit of a re-work as well, considering we're looking for a outdated gameList that is (now) refreshed and hiding closed games upon reconnection of the socket

If you have any questions you can reach out in the #code channel on our Discord

Thanks for reviewing. Can you please elaborate what I can do now?

Haviles04 commented 1 month ago

Nice work! This looks good As far as the failing test it looks like the test will need a little bit of a re-work as well, considering we're looking for a outdated gameList that is (now) refreshed and hiding closed games upon reconnection of the socket If you have any questions you can reach out in the #code channel on our Discord

Thanks for reviewing. Can you please elaborate what I can do now?

When we wrote this test we checked that it was not possible to join a outdated game when the socket refreshed, after your code, the list refreshes on socket reconnect and the outdated games are no longer shown and can't be selected to join. I think it might be sufficient to make sure that there is no games in the list now. @itsalaidbacklife, thoughts?

Haviles04 commented 1 month ago

@Mang0codes I think it's sufficient to change the failing assertion to make sure there are no games in the list

Mang0codes commented 1 month ago

@Mang0codes I think it's sufficient to change the failing assertion to make sure there are no games in the list

Screenshot 2024-10-18 213540 Did you mean like this?? Before it was: cy.get('[data-cy=game-list-item]').should('have.length', 1);

Yea I think that would work, making sure we check length = 0

Mang0codes commented 1 month ago

@Haviles04 Can you please review the changes. I think I'm still missing something

Haviles04 commented 1 month ago

In the failing test case, I think we can likely remove lines 299-302 and replace them with a copy of line 307

Haviles04 commented 4 days ago

@Mang0codes are you still interested in working on this?

Mang0codes commented 3 days ago

@Mang0codes are you still interested in working on this?

I don't have much experience with writing tests... You can assign this to someone else