mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 23:27:55 -05:00
"edits an event" E2E test
This commit is contained in:
2
TODO.md
2
TODO.md
@@ -13,7 +13,7 @@ Calendar
|
||||
- [x] Edit page
|
||||
- [x] E2E test form controls (adding/removing date, adding/removing tags) etc.
|
||||
- [ ] E2E test browsing events + event page
|
||||
- [ ] E2E test adding and editing event
|
||||
- [x] E2E test adding and editing event
|
||||
- [ ] Add winners page
|
||||
- [ ] Winners on the event info page
|
||||
- [ ] There should be a banner on the list page if you have past tournaments to report
|
||||
|
||||
@@ -17,6 +17,7 @@ const ADMIN_TEST_AVATAR = "e424e1ba50d2019fdc4730d261e56c55";
|
||||
|
||||
const NZAP_TEST_DISCORD_ID = "455039198672453645";
|
||||
const NZAP_TEST_AVATAR = "f809176af93132c3db5f0a5019e96339"; // https://cdn.discordapp.com/avatars/455039198672453645/f809176af93132c3db5f0a5019e96339.webp?size=160
|
||||
const NZAP_TEST_ID = 2;
|
||||
|
||||
const AMOUNT_OF_CALENDAR_EVENTS = 100;
|
||||
|
||||
@@ -353,7 +354,7 @@ function calendarEvents() {
|
||||
description: faker.lorem.paragraph(),
|
||||
discordInviteCode: faker.lorem.word(),
|
||||
bracketUrl: faker.internet.url(),
|
||||
authorId: userIds.pop(),
|
||||
authorId: id === 1 ? NZAP_TEST_ID : userIds.pop(),
|
||||
tags:
|
||||
Math.random() > 0.2
|
||||
? tags
|
||||
|
||||
@@ -64,6 +64,17 @@ describe("New calendar event page", () => {
|
||||
cy.getCy("badges-select").select(1);
|
||||
|
||||
cy.getCy("submit-button").click();
|
||||
cy.url().should("include", "101"); // we should have been redirected to the new event's page
|
||||
cy.url().should("include", "/101"); // we should have been redirected to the new event's page
|
||||
});
|
||||
|
||||
it("edits an event", () => {
|
||||
cy.auth(2);
|
||||
cy.visit(calendarEditPage(1));
|
||||
|
||||
cy.getCy("name-input").clear().type("Edited Event");
|
||||
|
||||
cy.getCy("submit-button").click();
|
||||
cy.url().should("include", "/1"); // we should have been redirected to the new event's page
|
||||
cy.contains("Edited Event");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user