Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

622 B
Raw Blame
import { describe, it, expect } from 'vitest'
import { avatarSrc } from './avatarSrc'

describe('avatarSrc', () => {
  it('prefixes an uploaded file name with the avatars path', () => {
    expect(avatarSrc('abc123.jpg')).toBe('/uploads/avatars/abc123.jpg')
  })

  it('passes an absolute https URL (OIDC picture) through untouched', () => {
    expect(avatarSrc('https://idp.example.com/u/pic.png')).toBe('https://idp.example.com/u/pic.png')
  })

  it('returns null for empty input', () => {
    expect(avatarSrc(null)).toBeNull()
    expect(avatarSrc(undefined)).toBeNull()
    expect(avatarSrc('')).toBeNull()
  })
})