Delete notifications before test

This commit is contained in:
Daniel Egger 2023-06-21 14:44:20 +02:00
parent e6a5af56a8
commit c715a462d9
2 changed files with 4 additions and 5 deletions

View File

@ -9,7 +9,6 @@ describe("notification list page", () => {
it("can paginate notifications", () => {
login("admin", "test");
cy.visit("/notifications");
cy.wait(2000);
cy.get('[data-cy="no-notifications"]').should("not.exist");
cy.get("[data-cy^=notification-idx-]").should("have.length", 7);
@ -22,7 +21,7 @@ describe("notification list page", () => {
// We load additional 7 notifications
cy.get('[data-cy="load-more-notifications"]').click();
cy.get("[data-cy^=notification-idx-]").should("have.length", 14);
cy.get("[data-cy^=notification-idx-]").should("have.length", 13);
for (let i = 0; i < 7; i++) {
cy.get(`[data-cy=notification-idx-${i}]`).within(() => {
@ -65,7 +64,6 @@ describe("notification popover", () => {
it("displays four notifications", () => {
login("admin", "test");
cy.visit("/");
cy.wait(1000);
toggleNotificationPopover();
cy.get("[data-cy^=notification-idx-]").should("have.length", 4);
@ -74,7 +72,6 @@ describe("notification popover", () => {
it("can show all notifications", () => {
login("admin", "test");
cy.visit("/");
cy.wait(1000);
toggleNotificationPopover();
cy.get('[data-cy="show-all-notifications"]').click({ force: true });
@ -111,6 +108,7 @@ describe("email notification settings", () => {
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').click();
cy.get('[data-cy="it-checkbox-INFORMATION"]').click();
cy.wait(500);
cy.reload();
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').should(
"have.class",
@ -128,6 +126,7 @@ describe("email notification settings", () => {
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').click();
cy.get('[data-cy="it-checkbox-INFORMATION"]').click();
cy.wait(500);
cy.reload();
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').should(
"have.class",

View File

@ -22,7 +22,7 @@ from vbv_lernwelt.notify.models import Notification
def command(create_completion):
print("cypress reset data")
CourseCompletion.objects.all().delete()
Notification.objects.all().mark_all_as_deleted()
Notification.objects.all().delete()
AssignmentCompletion.objects.all().delete()
User.objects.all().update(language="de")
User.objects.all().update(additional_json_data={})