Basically all views should have some sort of verification that they're working. This should cover being signed in, signed out, on mobile, on desktop and any error states. (thread not found, private channel, channel not found etc etc)
Note that this doesn't mean every bit and piece needs to be verified. What we're looking for is a quick note "This still mostly works after this PR is merged". For example, on the user page we probably only want to verify that the users information is somewhere on the page, their communities (and only theirs) are listed and their threads are listed. (and only theirs)
See the testing docs for more information.
For an example of what a test looks like, this is what the current Splash page tests look like:
it('should render the splash page', async () => {
await page.goto('http://localhost:3000/');
await page.waitForSelector('[data-e2e-id="splash-page"]');
});
it('should have a login button', async () => {
await page.goto('http://localhost:3000/');
await page.waitForSelector('[href*="/login"]');
});
it('should have a button to explore', async () => {
await page.goto('http://localhost:3000/');
await page.waitForSelector('[href*="/explore"]');
});
it('should have a button to /new/community', async () => {
await page.goto('http://localhost:3000/');
await page.waitForSelector('[href*="/new/community"]');
});
Those are the four things we care about on this page. We don't care about the exact contents, we don't care about what the secions are, how many there are, how they are called, doesn't matter! What we want to know is: Rendering it doesn't throw an error, we got a button to login, to explore and to new community. That's all.
There's maybe an untested part there which is that the search on the splash page works, which I guess we could also verify.
@mxstbr I'd like to write some cypress tests if this is still needed! I think the checklist in the original post might be outdated? Looks you wrote it before you started using cypress. And I realize you don't want every feature under E2E test coverage -- do you have an updated priority list? Or some tooling set up to evaluate code coverage to help build such a list?
If not, happy to look into finding something to help with code coverage, or just cherry pick some features to test.
@tadasant yes please! This list is indeed out of date, let me see if I can figure out a new one of stuff that isn't tested yet...
The inbox view is not very well tested yet, although it's a pretty core part of the Spectrum experience! Things that aren't covered yet are:
@mxstbr Can you please update the issue with the things that are still relevant or new things that we need to work on? Or any new follow-ups related to this topic?
I'm planning to take this up for my first contribution to spectrum. ✋
@mxstbr Any update?
Most helpful comment
The inbox view is not very well tested yet, although it's a pretty core part of the Spectrum experience! Things that aren't covered yet are: