Repository navigation
PassChevronTYをPassChevronEastに改名、その他リファクタリング - #5787
Conversation
📝 WalkthroughWalkthrough
Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/LineBoard/shared/components/LineDot.test.tsx (1)
34-41: testIDの命名がコンポーネント名と不整合です。モックのパスは
PassChevronEastに更新されていますが、testIDはpass-chevron-tyのままです。一貫性のためpass-chevron-eastに更新することを推奨します。♻️ 修正案
jest.mock('../../../PassChevronEast', () => { const _React = require('react'); const { View } = require('react-native'); return { __esModule: true, - default: () => <View testID="pass-chevron-ty" />, + default: () => <View testID="pass-chevron-east" />, }; });Line 75, 93のアサーションも同様に更新が必要です:
- expect(getByTestId('pass-chevron-ty')).toBeTruthy(); + expect(getByTestId('pass-chevron-east')).toBeTruthy();- expect(queryByTestId('pass-chevron-ty')).toBeNull(); + expect(queryByTestId('pass-chevron-east')).toBeNull();🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/LineBoard/shared/components/LineDot.test.tsx` around lines 34 - 41, The mocked component PassChevronEast returns a View with testID "pass-chevron-ty" which is inconsistent with the component name; update the mock in LineDot.test.tsx so the returned View uses testID "pass-chevron-east" and then update all corresponding test assertions that expect "pass-chevron-ty" (the assertions around where the mock is used) to assert "pass-chevron-east" instead so names are consistent (search for usages of testID "pass-chevron-ty" and replace them).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/components/LineBoard/shared/components/LineDot.test.tsx`:
- Around line 34-41: The mocked component PassChevronEast returns a View with
testID "pass-chevron-ty" which is inconsistent with the component name; update
the mock in LineDot.test.tsx so the returned View uses testID
"pass-chevron-east" and then update all corresponding test assertions that
expect "pass-chevron-ty" (the assertions around where the mock is used) to
assert "pass-chevron-east" instead so names are consistent (search for usages of
testID "pass-chevron-ty" and replace them).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c7f7f2eb-21a0-4ba8-bc54-5f2a44651d6d
📒 Files selected for processing (7)
src/components/LineBoard/shared/components/LineDot.test.tsxsrc/components/LineBoard/shared/components/LineDot.tsxsrc/components/LineBoardE231.tsxsrc/components/LineBoardEast.tsxsrc/components/LineBoardJO.test.tsxsrc/components/LineBoardJO.tsxsrc/components/PassChevronEast.tsx
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/LineBoard/shared/components/LineDot.test.tsx (1)
93-93: 非通過ケースはLinearGradientの直接検証を追加するとより堅牢です。現状は
pass-chevron-eastの不在確認が中心なので、テスト名どおりLinearGradient自体の存在確認も入れると回帰耐性が上がります。♻️ 例: 検証強化差分
- const { queryByTestId, getByTestId } = render( + const { queryByTestId, getByTestId, UNSAFE_getByType } = render( <LineDot station={mockStation} shouldGrayscale={false} transferLines={mockTransferLines} arrived={false} passed={false} /> ); expect(queryByTestId('pass-chevron-east')).toBeNull(); expect(getByTestId('pad-line-marks')).toBeTruthy(); + const LinearGradient = require('expo-linear-gradient').LinearGradient; + expect(UNSAFE_getByType(LinearGradient)).toBeTruthy();As per coding guidelines "Test agents in isolation and with integration tests to ensure correctness and compatibility".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/LineBoard/shared/components/LineDot.test.tsx` at line 93, The test currently only asserts that queryByTestId('pass-chevron-east') is null; additionally assert the absence (or presence as appropriate for the non-pass case) of the LinearGradient element to make the test more robust: locate the test for the LineDot component in LineDot.test.tsx and add an assertion that queries for the LinearGradient (by its testID or component name used in rendering) and expects it to be null in the non-pass scenario so the test verifies the LinearGradient is not rendered alongside the chevron absence.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/components/LineBoard/shared/components/LineDot.test.tsx`:
- Line 93: The test currently only asserts that
queryByTestId('pass-chevron-east') is null; additionally assert the absence (or
presence as appropriate for the non-pass case) of the LinearGradient element to
make the test more robust: locate the test for the LineDot component in
LineDot.test.tsx and add an assertion that queries for the LinearGradient (by
its testID or component name used in rendering) and expects it to be null in the
non-pass scenario so the test verifies the LinearGradient is not rendered
alongside the chevron absence.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 59e2102f-45d6-4695-b9a3-0e27dc4640b7
📒 Files selected for processing (1)
src/components/LineBoard/shared/components/LineDot.test.tsx
概要
変更の種類
変更内容
テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
Summary by CodeRabbit
リリースノート