feat: implement project development module, transfer management features, and industrial AVM model integration
This commit is contained in:
@@ -142,6 +142,33 @@ describe('ListingEntity', () => {
|
||||
const fields = listing.updateContent({});
|
||||
expect(fields).toEqual([]);
|
||||
});
|
||||
|
||||
it('should emit ListingPriceChangedEvent when price actually changes', () => {
|
||||
const listing = makeDefaultListing();
|
||||
listing.clearDomainEvents();
|
||||
|
||||
listing.updateContent({ priceVND: 6_000_000_000n, areaM2: 100 });
|
||||
|
||||
const events = listing.domainEvents;
|
||||
const priceEvent = events.find((e) => e.eventName === 'listing.price_changed');
|
||||
expect(priceEvent).toBeDefined();
|
||||
expect((priceEvent as { oldPrice: bigint; newPrice: bigint }).oldPrice).toBe(
|
||||
5_000_000_000n,
|
||||
);
|
||||
expect((priceEvent as { oldPrice: bigint; newPrice: bigint }).newPrice).toBe(
|
||||
6_000_000_000n,
|
||||
);
|
||||
});
|
||||
|
||||
it('should NOT emit ListingPriceChangedEvent when price stays the same', () => {
|
||||
const listing = makeDefaultListing();
|
||||
listing.clearDomainEvents();
|
||||
|
||||
listing.updateContent({ priceVND: 5_000_000_000n, areaM2: 100 });
|
||||
|
||||
const events = listing.domainEvents;
|
||||
expect(events.some((e) => e.eventName === 'listing.price_changed')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('markEditedForReModeration', () => {
|
||||
|
||||
Reference in New Issue
Block a user