web: fix reminder tests

This commit is contained in:
Abdullah Atta
2023-12-27 10:14:20 +05:00
parent 339e5965bb
commit a437125730
5 changed files with 6 additions and 5 deletions

View File

@@ -47,7 +47,7 @@ export async function fillReminderDialog(
page: Page,
reminder: Partial<Reminder>
) {
const dialog = page.locator(getTestId("reminder-dialog"));
const dialog = page.locator(getTestId("add-reminder-dialog"));
const titleInput = dialog.locator(getTestId("title-input"));
const descriptionInput = dialog.locator(getTestId("description-input"));
const dateInput = dialog.locator(getTestId("date-input"));

View File

@@ -108,7 +108,7 @@ function Reminder(props: ReminderProps) {
}
export default React.memo(Reminder, (prev, next) => {
return prev?.item?.title === next?.item?.title;
return prev.item.dateModified === next.item.dateModified;
});
const menuItems: (reminder: ReminderType, items?: string[]) => MenuItem[] = (
@@ -133,7 +133,7 @@ const menuItems: (reminder: ReminderType, items?: string[]) => MenuItem[] = (
id: reminder.id,
disabled: !reminder.disabled
});
store.refresh();
await store.refresh();
}
},
{ key: "sep", type: "separator" },

View File

@@ -152,7 +152,7 @@ export default function AddReminderDialog(props: AddReminderDialogProps) {
<Dialog
isOpen={true}
title={reminderId ? "Edit reminder" : "Add a reminder"}
description={""}
testId="add-reminder-dialog"
onClose={() => props.onClose(false)}
positiveButton={{
text: reminderId ? "Save" : "Add",

View File

@@ -66,5 +66,6 @@
"sharedGlobals": [],
"production": ["default"]
},
"parallel": 4,
"nxCloudAccessToken": "ZWM3ODgxNDgtNGUzZC00MjQ0LWE3MzMtZDdhMzE3ZGY2MWFlfHJlYWQ="
}

View File

@@ -57,7 +57,7 @@ export class Reminders implements ICollection {
throw new Error("Please use db.reminders.merge to merge reminders.");
const id = reminder.id || getId();
const oldReminder = this.collection.get(id);
const oldReminder = await this.collection.get(id);
reminder = {
...oldReminder,