github.test.ts22 lines · main
1import { describe, expect, it, vi } from 'vitest'
2
3import { getGitHubProfileImgUrl, openInstallGitHubIntegrationWindow } from './github'
4
5// mock window.open
6vi.stubGlobal('open', vi.fn())
7
8describe('openInstallGitHubIntegrationWindow', () => {
9 it('should open the install window', () => {
10 openInstallGitHubIntegrationWindow('install')
11
12 expect(window.open).toHaveBeenCalled()
13 })
14})
15
16describe('getGitHubProfileImgUrl', () => {
17 it('should return the correct URL', () => {
18 const result = getGitHubProfileImgUrl('test')
19
20 expect(result).toBe('https://github.com/test.png?size=96')
21 })
22})