browser.spec.ts 516 B

12345678910111213141516
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { generateFingerprint } from '../browser.ts'
  3. vi.hoisted(() => {
  4. const userAgentSpy = vi.spyOn(window.navigator, 'userAgent', 'get')
  5. userAgentSpy.mockReturnValue(
  6. 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4758.102 Safari/537.36',
  7. )
  8. })
  9. describe('browser', () => {
  10. it('generate fingerprint', () => {
  11. expect(generateFingerprint()).toBe('1613472439')
  12. })
  13. })