It basically tests all the sub-components when wired together
Filled in stub test for useCoderWorkspacesQuery
Updated how mock data was defined, and changed how the MSW handlers were returning data
Notes
There is one more behavior that could use a test, but I'm not sure if it's worth it. Basic steps are:
Log into the Coder deployment with user account 1
Log into Backstage
Get the auth token for user account 1, and insert it
Go back to the Coder deployment, log out, and then log in with user account 2
Expect that the workspaces for user account 1 no longer appear
I was running into this when I was logged into the Full-stack challenge account, but had a token loaded for my personal Coder account. I think there is a way to simulate this at least, but:
I don't know if it's 100% reliable and would give us that much confidence
I don't know if this edge case is too niche to warrant complicating some of the testing setup
Closes #8
Changes made
CoderWorkspacesCard
useCoderWorkspacesQuery
Notes
There is one more behavior that could use a test, but I'm not sure if it's worth it. Basic steps are:
I was running into this when I was logged into the Full-stack challenge account, but had a token loaded for my personal Coder account. I think there is a way to simulate this at least, but: