Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

635 B
Raw Blame
// @vitest-environment jsdom
import { describe, expect, it, vi } from 'vitest'

import { getGitHubProfileImgUrl, openInstallGitHubIntegrationWindow } from './github'

// mock window.open
vi.stubGlobal('open', vi.fn())

describe('openInstallGitHubIntegrationWindow', () => {
  it('should open the install window', () => {
    openInstallGitHubIntegrationWindow('install')

    expect(window.open).toHaveBeenCalled()
  })
})

describe('getGitHubProfileImgUrl', () => {
  it('should return the correct URL', () => {
    const result = getGitHubProfileImgUrl('test')

    expect(result).toBe('https://github.com/test.png?size=96')
  })
})