Files
orca/src/shared/source-control-group-order.test.ts
T
Jinjing 8aa7f9c047 Combine untracked files into Changes (#31831)
* Combine untracked files into the Changes section

* Localize discard warnings
2026-10-21 22:23:59 -07:00

24 lines
912 B
TypeScript

import { describe, expect, it } from 'vitest'
import {
DEFAULT_SOURCE_CONTROL_GROUP_ORDER,
normalizeSourceControlGroupOrder
} from './source-control-group-order'
describe('normalizeSourceControlGroupOrder', () => {
it('keeps supported source control group orders', () => {
expect(normalizeSourceControlGroupOrder('changes-first')).toBe('changes-first')
expect(normalizeSourceControlGroupOrder('staged-first')).toBe('staged-first')
})
it('maps the legacy untracked-first preference to combined Changes first', () => {
expect(normalizeSourceControlGroupOrder('untracked-first')).toBe('changes-first')
})
it('falls back to the default for malformed values', () => {
expect(normalizeSourceControlGroupOrder('tracked-first')).toBe(
DEFAULT_SOURCE_CONTROL_GROUP_ORDER
)
expect(normalizeSourceControlGroupOrder(undefined)).toBe(DEFAULT_SOURCE_CONTROL_GROUP_ORDER)
})
})