mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
web: fix reminder tests
This commit is contained in:
@@ -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"));
|
||||
|
||||
@@ -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" },
|
||||
|
||||
@@ -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",
|
||||
|
||||
1
nx.json
1
nx.json
@@ -66,5 +66,6 @@
|
||||
"sharedGlobals": [],
|
||||
"production": ["default"]
|
||||
},
|
||||
"parallel": 4,
|
||||
"nxCloudAccessToken": "ZWM3ODgxNDgtNGUzZC00MjQ0LWE3MzMtZDdhMzE3ZGY2MWFlfHJlYWQ="
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user