mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 17:37:40 +00:00
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
getLocalhostWorktreeHostLabel,
|
|
getLocalhostWorktreeRouteKey
|
|
} from './localhost-worktree-labels'
|
|
|
|
describe('localhost worktree labels', () => {
|
|
it('uses the worktree folder name over branch owner prefixes for non-main labels', () => {
|
|
expect(
|
|
getLocalhostWorktreeHostLabel({
|
|
projectName: 'Snap Studio',
|
|
worktreeName: 'gatsby74/table-summary',
|
|
worktreePath: '/Users/example/orca/workspaces/snapstudio/ui-auth'
|
|
})
|
|
).toBe('ui-auth')
|
|
})
|
|
|
|
it('keeps route keys unique for different ports in the same worktree', () => {
|
|
const route = {
|
|
projectName: 'Snap Studio',
|
|
worktreeName: 'analytics',
|
|
repoId: 'repo-1',
|
|
worktreeId: 'wt-analytics'
|
|
}
|
|
|
|
expect(
|
|
getLocalhostWorktreeRouteKey({
|
|
...route,
|
|
targetUrl: 'http://localhost:5173/'
|
|
})
|
|
).not.toBe(
|
|
getLocalhostWorktreeRouteKey({
|
|
...route,
|
|
targetUrl: 'http://localhost:7777/'
|
|
})
|
|
)
|
|
})
|
|
})
|