resolve todos in website
This commit is contained in:
28
core/identity/application/use-cases/LogoutUseCase.test.ts
Normal file
28
core/identity/application/use-cases/LogoutUseCase.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { describe, it, expect, vi, type Mock } from 'vitest';
|
||||
import { LogoutUseCase } from './LogoutUseCase';
|
||||
import type { IdentitySessionPort } from '../ports/IdentitySessionPort';
|
||||
|
||||
describe('LogoutUseCase', () => {
|
||||
let sessionPort: {
|
||||
clearSession: Mock;
|
||||
getCurrentSession: Mock;
|
||||
createSession: Mock;
|
||||
};
|
||||
let useCase: LogoutUseCase;
|
||||
|
||||
beforeEach(() => {
|
||||
sessionPort = {
|
||||
clearSession: vi.fn(),
|
||||
getCurrentSession: vi.fn(),
|
||||
createSession: vi.fn(),
|
||||
};
|
||||
|
||||
useCase = new LogoutUseCase(sessionPort as unknown as IdentitySessionPort);
|
||||
});
|
||||
|
||||
it('clears the current session', async () => {
|
||||
await useCase.execute();
|
||||
|
||||
expect(sessionPort.clearSession).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user