MeetUp/cypress/e2e/event-create.cy.ts
Dominik Stahl 1ec636f3b0
All checks were successful
tests / Tests (pull_request) Successful in 3m45s
docker-build / docker (pull_request) Successful in 3m47s
container-scan / Container Scan (pull_request) Successful in 2m38s
test: add event creation test
2025-07-01 10:10:42 +02:00

40 lines
1.4 KiB
TypeScript

describe('event creation', () => {
it('loads', () => {
cy.login();
cy.visit('http://127.0.0.1:3000/events/new');
cy.getBySel('event-form').should('exist');
cy.getBySel('event-form').within(() => {
cy.getBySel('event-name-input').should('exist');
cy.getBySel('event-start-time-picker').should('exist');
cy.getBySel('event-end-time-picker').should('exist');
cy.getBySel('event-location-input').should('exist');
cy.getBySel('event-description-input').should('exist');
cy.getBySel('event-save-button').should('exist');
});
});
it('creates an event', () => {
cy.login();
cy.visit(
'http://127.0.0.1:3000/events/new?start=2025-07-01T01:00:00.000Z&end=2025-07-01T04:30:00.000Z',
);
cy.getBySel('event-form').should('exist');
cy.getBySel('event-form').within(() => {
cy.getBySel('event-name-input').type('Cypress Test Event');
cy.getBySel('event-location-input').type('Cypress Park');
cy.getBySel('event-description-input').type(
'This is a test event created by Cypress.',
);
cy.getBySel('event-save-button').click();
});
cy.wait(1000);
cy.visit('http://127.0.0.1:3000/events');
cy.getBySel('event-list-entry').should('exist');
cy.getBySel('event-list-entry')
.contains('Cypress Test Event')
.should('exist');
cy.getBySel('event-list-entry').contains('Cypress Park').should('exist');
});
});