41 lines
1.7 KiB
JavaScript
41 lines
1.7 KiB
JavaScript
/// <reference types="cypress" />
|
|
describe("Reminder features", () => {
|
|
it("should work", () => {
|
|
const dNow = new Date();
|
|
const dToday = `${dNow.getFullYear()}-${(dNow.getMonth() + 1)
|
|
.toString()
|
|
.padStart(2, "0")}-${dNow.getDate().toString().padStart(2, "0")}`;
|
|
const tNow = `${dNow.getHours().toString().padStart(2, "0")}:${dNow
|
|
.getMinutes()
|
|
.toString()
|
|
.padStart(2, "0")}`;
|
|
const tOneHourFromNow = `${(dNow.getHours() + 1)
|
|
.toString()
|
|
.padStart(2, "0")}:${dNow.getMinutes().toString().padStart(2, "0")}`;
|
|
|
|
cy.ayLogin("accounting");
|
|
cy.aySetTestableUserOptions();
|
|
cy.visit("/home-reminders");
|
|
cy.url().should("include", "/home-reminders");
|
|
cy.get("[data-cy='reminder-list:new']:first").click();
|
|
cy.url().should("include", "/home-reminders/");
|
|
cy.get("[data-cy=name]").type(
|
|
`${Cypress.config("cyid")}-test-reminder{enter}`
|
|
);
|
|
cy.get("[data-cy='startDate:date']").type(dToday);
|
|
cy.get("[data-cy='startDate:time']").type(tNow);
|
|
cy.get("[data-cy='stopDate:date']").type(dToday);
|
|
cy.get("[data-cy='stopDate:time']").type(tOneHourFromNow);
|
|
cy.get("[data-cy=notes]").type(`This is a reminder{enter}eot{enter}`);
|
|
cy.get(".v-color-picker__input > input").clear().type("#11E1D07E{enter}"); //select a color
|
|
cy.get('[data-cy="reminder-edit:save"] > .v-btn__content').click();
|
|
cy.visit("/home-reminders");
|
|
cy.url().should("include", "/home-reminders");
|
|
|
|
//should show reminder made above in month display by default
|
|
cy.visit("/home-schedule");
|
|
cy.url().should("include", "/home-schedule");
|
|
cy.contains(`${Cypress.config("cyid")}-test-reminder`);
|
|
});
|
|
});
|