Skip to content

Commit

Permalink
fix: datepicker test failing when validation is called an extra time
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Dec 14, 2023
1 parent e263fe8 commit 3721bfd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/topics/audit-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public class AppDbContext : DbContext, IAuditLogDbContext<AuditLog>

The `AuditLogProperty` children of your `IAuditLog` implementation have two properties `OldValueDescription` and `NewValueDescription` that can be used to hold a description of the old and new values. By default, Coalesce will populate the descriptions of foreign key properties with the [List Text](/modeling/model-components/attributes/list-text.md) of the referenced principal entity. This greatly improves the usability of the audit logs, which would otherwise only show meaningless numbers or GUIDs for foreign keys that changed.

This feature will load principal entities into the `DbContext` if they are not already loaded, which could inflict subtle differences in application functionality in rare edge cases if your application is making assumptions about navigation properties not being loaded. Typically though, this will not be an issue and will not lead unintentional information disclosure to clients as along as [IncludeTree](/concepts/include-tree.md)s are used correctly.
This feature will load principal entities into the `DbContext` if they are not already loaded, which could inflict subtle differences in application functionality in rare edge cases if your application is making assumptions about navigation properties not being loaded. Typically though, this will not be an issue and will not lead unintentional information disclosure to clients as long as [IncludeTree](/concepts/include-tree.md)s are used correctly.

This feature may be disabled by calling `.WithPropertyDescriptions(PropertyDescriptionMode.None)` inside your call to `.UseCoalesceAuditLogging(...)` in your DbContext configuration. You may also populate these descriptions in your `IAuditOperationContext` implementation that was provided to `.WithAugmentation<T>()`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ describe("CDatetimePicker", () => {
await delay(1);
expect(wrapper.text()).toContain("Year must be > 2017");
expect(model.birthDate?.getFullYear()).toBe(2017);
expect(rule).toBeCalledTimes(1);
expect(rule).toBeCalledWith(model.birthDate);
expect(rule).toHaveBeenLastCalledWith(model.birthDate);

// Do it again, but with a valid input this time. The error should be gone.
await wrapper.find("input").setValue("1/3/2018");
await delay(1);
expect(wrapper.text()).not.toContain("Year must be > 2017");
expect(model.birthDate?.getFullYear()).toBe(2018);
expect(rule).toBeCalledTimes(2);
expect(rule).toHaveBeenLastCalledWith(model.birthDate);
});
});

0 comments on commit 3721bfd

Please sign in to comment.