[优化] 改名

This commit is contained in:
ryan
2026-03-15 16:04:54 +08:00
parent d68773c554
commit 32d90ba641
304 changed files with 629 additions and 969 deletions
@@ -0,0 +1,17 @@
import { describe, expect, it } from 'vitest';
import { getCurrentNavigationItem, isPathActive } from '@/lib/utils/navigation';
describe('navigation utils', () => {
it('marks root path as active only for home', () => {
expect(isPathActive('/', '/')).toBe(true);
expect(isPathActive('/node', '/')).toBe(false);
});
it('resolves current navigation item for nested paths', () => {
expect(getCurrentNavigationItem('/node/abc')?.label).toBe('节点');
expect(getCurrentNavigationItem('/website')?.label).toBe('网站');
expect(getCurrentNavigationItem('/performance')?.label).toBe('性能');
expect(getCurrentNavigationItem('/setting')?.label).toBe('设置');
});
});