Skip to content

Commit

Permalink
web: fix reminder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Mar 21, 2024
1 parent 339e596 commit a437125
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/web/__e2e__/models/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/reminder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = (
Expand All @@ -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" },
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/dialogs/add-reminder-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,6 @@
"sharedGlobals": [],
"production": ["default"]
},
"parallel": 4,
"nxCloudAccessToken": "ZWM3ODgxNDgtNGUzZC00MjQ0LWE3MzMtZDdhMzE3ZGY2MWFlfHJlYWQ="
}
2 changes: 1 addition & 1 deletion packages/core/src/collections/reminders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a437125

Please sign in to comment.