-
Notifications
You must be signed in to change notification settings - Fork 17
Added tests for a guest user to see the list page when there are no torrents in the index #313
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
Conversation
d1df838
to
c969ad3
Compare
5f68e24
to
82ed545
Compare
… when there are no torrents in the index
82ed545
to
b1e9ab6
Compare
import { baseURL } from "nuxt/dist/core/runtime/nitro/paths";
describe("A guest user", () => {
before(() => {
// Deletes all torrents and their related info from the database so the test can pass
cy.clear_torrent_info_from_database();
});
it("Should be able to see the list page when there are no torrents", () => {
cy.visit("/torrents");
cy.url().should("match", /\/torrents$/);
cy.get("[data-cy=\"no-results-element\"]").invoke("text").should("match", /No results./i);
});
}); @josecelano Do you think is worth implementing the test with an admin/logged in user too?, I don't think it would change the result of the test, but wanted a second opinion. |
I always have doubts about E2E tests. The other two tests seem more like a test for the permissions. I guess here we are testing the feature that users see a friendly message when there are no torrents, not that users can see this content. Since we are using the role with the lowest permissions, I think it's ok. Maybe we can change the describe section |
@josecelano I really like the idea of using "Users", I will refactor that part. |
@josecelano Ready for review |
ACK 6d6806d |
Resolves #310.