diff --git a/src/modules/cards/tests/application/CreateCollectionUseCase.test.ts b/src/modules/cards/tests/application/CreateCollectionUseCase.test.ts index 6967040c..319c1998 100644 --- a/src/modules/cards/tests/application/CreateCollectionUseCase.test.ts +++ b/src/modules/cards/tests/application/CreateCollectionUseCase.test.ts @@ -58,17 +58,6 @@ describe('CreateCollectionUseCase', () => { expect(savedCollection.accessType).toBe(CollectionAccessType.CLOSED); expect(savedCollection.isPublished).toBe(true); expect(savedCollection.publishedRecordId).toBeDefined(); - - // Verify CollectionCreatedEvent was published - const createdEvents = eventPublisher.getPublishedEventsOfType( - EventNames.COLLECTION_CREATED, - ) as CollectionCreatedEvent[]; - expect(createdEvents).toHaveLength(1); - expect(createdEvents[0]?.collectionId.getStringValue()).toBe( - response.collectionId, - ); - expect(createdEvents[0]?.authorId.equals(curatorId)).toBe(true); - expect(createdEvents[0]?.collectionName).toBe('My Test Collection'); }); it('should create collection without description', async () => { @@ -90,15 +79,6 @@ describe('CreateCollectionUseCase', () => { const savedCollection = savedCollections[0]!; expect(savedCollection.name.value).toBe('Collection Without Description'); expect(savedCollection.description).toBeUndefined(); - - // Verify CollectionCreatedEvent was published - const createdEvents = eventPublisher.getPublishedEventsOfType( - EventNames.COLLECTION_CREATED, - ) as CollectionCreatedEvent[]; - expect(createdEvents).toHaveLength(1); - expect(createdEvents[0]?.collectionName).toBe( - 'Collection Without Description', - ); }); it('should publish collection after creation', async () => { @@ -118,13 +98,6 @@ describe('CreateCollectionUseCase', () => { const publishedCollection = publishedCollections[0]!; expect(publishedCollection.name.value).toBe('Published Collection'); - - // Verify CollectionCreatedEvent was published - const createdEvents = eventPublisher.getPublishedEventsOfType( - EventNames.COLLECTION_CREATED, - ) as CollectionCreatedEvent[]; - expect(createdEvents).toHaveLength(1); - expect(createdEvents[0]?.collectionName).toBe('Published Collection'); }); }); @@ -265,15 +238,6 @@ describe('CreateCollectionUseCase', () => { expect(savedCollection.publishedRecordId).toBeDefined(); expect(savedCollection.publishedRecordId?.uri).toBeDefined(); expect(savedCollection.publishedRecordId?.cid).toBeDefined(); - - // Verify CollectionCreatedEvent was published - const createdEvents = eventPublisher.getPublishedEventsOfType( - EventNames.COLLECTION_CREATED, - ) as CollectionCreatedEvent[]; - expect(createdEvents).toHaveLength(1); - expect(createdEvents[0]?.collectionName).toBe( - 'Successfully Published Collection', - ); }); }); @@ -335,16 +299,6 @@ describe('CreateCollectionUseCase', () => { const collectionNames = savedCollections.map((c) => c.name.value); expect(collectionNames).toContain('First Collection'); expect(collectionNames).toContain('Second Collection'); - - // Verify CollectionCreatedEvent was published for both collections - const createdEvents = eventPublisher.getPublishedEventsOfType( - EventNames.COLLECTION_CREATED, - ) as CollectionCreatedEvent[]; - expect(createdEvents).toHaveLength(2); - - const eventNames = createdEvents.map((event) => event.collectionName); - expect(eventNames).toContain('First Collection'); - expect(eventNames).toContain('Second Collection'); }); }); });