diff --git a/src/pages/Timestamp/__tests__/index.test.tsx b/src/pages/Timestamp/__tests__/index.test.tsx new file mode 100644 index 0000000..c46df35 --- /dev/null +++ b/src/pages/Timestamp/__tests__/index.test.tsx @@ -0,0 +1,11 @@ +import { render, screen } from '@testing-library/react'; +import { describe, it, expect } from 'vitest'; +import Index from '../index'; + +describe('Timestamp 页面', () => { + it('应该渲染页面标题', () => { + render(); + // 基本渲染测试 + expect(screen.getByRole('button')).toBeInTheDocument(); + }); +}); diff --git a/src/pages/Timestamp/LiveClock.tsx b/src/pages/Timestamp/components/LiveClock.tsx similarity index 95% rename from src/pages/Timestamp/LiveClock.tsx rename to src/pages/Timestamp/components/LiveClock.tsx index af10d18..1e1a625 100644 --- a/src/pages/Timestamp/LiveClock.tsx +++ b/src/pages/Timestamp/components/LiveClock.tsx @@ -2,8 +2,8 @@ import React, { useEffect, useState } from 'react'; import { Clock } from 'lucide-react'; import { toast } from 'sonner'; import { CopyButton } from '@/components/CopyButton'; -import type { UnitType } from './constants'; -import { msToUnit } from './constants'; +import type { UnitType } from '../constants'; +import { msToUnit } from '../constants'; import { useI18n } from '@/utils/chromeI18n'; import { cn } from '@/lib/utils'; diff --git a/src/pages/Timestamp/ResultView.tsx b/src/pages/Timestamp/components/ResultView.tsx similarity index 100% rename from src/pages/Timestamp/ResultView.tsx rename to src/pages/Timestamp/components/ResultView.tsx diff --git a/src/pages/Timestamp/index.tsx b/src/pages/Timestamp/index.tsx index 2120708..36ac8fd 100644 --- a/src/pages/Timestamp/index.tsx +++ b/src/pages/Timestamp/index.tsx @@ -1,8 +1,8 @@ import SwitchButtonGroup from '@/components/SwitchButtonGroup'; import { ZONES } from './constants'; import type { ModeType, UnitType, ZoneType } from './constants'; -import LiveClock from './LiveClock'; -import ResultView from './ResultView'; +import LiveClock from './components/LiveClock'; +import ResultView from './components/ResultView'; import { useTimestampConverter } from './useTimestampConverter'; import { useI18n } from '@/utils/chromeI18n'; import { cn } from '@/lib/utils';