emitter.spec.ts 367 B

123456789101112131415
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import emitter from '../emitter.ts'
  3. describe('emitter', () => {
  4. it('check working emitter object', () => {
  5. const emitCallbackSpy = vi.fn()
  6. emitter.on('sessionInvalid', emitCallbackSpy)
  7. emitter.emit('sessionInvalid')
  8. expect(emitCallbackSpy).toHaveBeenCalled()
  9. })
  10. })