mirror of
https://gitlab.com/mobicoop/v3/service/ad.git
synced 2026-02-22 23:00:46 +00:00
adding testing for find ad by uuid
This commit is contained in:
@@ -50,7 +50,7 @@ describe('FindAdByUuidUseCase', () => {
|
|||||||
expect(findAdByUuidUseCase).toBeDefined();
|
expect(findAdByUuidUseCase).toBeDefined();
|
||||||
});
|
});
|
||||||
describe('execute', () => {
|
describe('execute', () => {
|
||||||
it('should return a user', async () => {
|
it('should return an ad', async () => {
|
||||||
const findAdByUuidRequest: FindAdByUuidRequest =
|
const findAdByUuidRequest: FindAdByUuidRequest =
|
||||||
new FindAdByUuidRequest();
|
new FindAdByUuidRequest();
|
||||||
findAdByUuidRequest.uuid = 'bb281075-1b98-4456-89d6-c643d3044a91';
|
findAdByUuidRequest.uuid = 'bb281075-1b98-4456-89d6-c643d3044a91';
|
||||||
@@ -59,7 +59,7 @@ describe('FindAdByUuidUseCase', () => {
|
|||||||
);
|
);
|
||||||
expect(user).toBe(mockAd);
|
expect(user).toBe(mockAd);
|
||||||
});
|
});
|
||||||
it('should throw an error if user does not exist', async () => {
|
it('should throw an error if ad does not exist', async () => {
|
||||||
const findAdByUuidRequest: FindAdByUuidRequest =
|
const findAdByUuidRequest: FindAdByUuidRequest =
|
||||||
new FindAdByUuidRequest();
|
new FindAdByUuidRequest();
|
||||||
findAdByUuidRequest.uuid = 'bb281075-1b98-4456-89d6-c643d3044a90';
|
findAdByUuidRequest.uuid = 'bb281075-1b98-4456-89d6-c643d3044a90';
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ describe('Messager', () => {
|
|||||||
|
|
||||||
it('should publish a message', async () => {
|
it('should publish a message', async () => {
|
||||||
jest.spyOn(mockAmqpConnection, 'publish');
|
jest.spyOn(mockAmqpConnection, 'publish');
|
||||||
messager.publish('user.create.info', 'my-test');
|
messager.publish('ad.create.info', 'my-test');
|
||||||
expect(mockAmqpConnection.publish).toHaveBeenCalledTimes(1);
|
expect(mockAmqpConnection.publish).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user