Component tests for AccountToggle

オープン
#3,780 コメント 5 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@sam-zc がすでに取り組んでいます。

2026年11月27日 から。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
78/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
react, typescript
領域
frontend, testing

調査の方向性

The component under test is src/components/AccountToggle.tsx, and the closest patterns are test/components/PRMetrics.test.tsx and DiffTrendChart.test.tsx. Read how those mount components and mock fetch with vi.fn(), then cover the loading, error (/api/accounts and /api/user/orgs failing), empty, main-content and interaction states. Done means a new test/components/AccountToggle.test.tsx passes with queries by role or label, not CSS classes.

索引モデルが issue の本文から書いたものです。

説明

good first issue level 1 level:beginner status:assigned type:testing
Summary

src/components/AccountToggle.tsx (186 lines) has no component tests.

What to test
  • loading state while the request is pending
  • error state when /api/accounts, /api/user/orgs fails
  • empty state when the API returns no data
  • the main rendered content with realistic props / mocked data
  • the main interactions (clicks, inputs) and what they change
How

Use React Testing Library like the tests in test/components/ (e.g. PRMetrics.test.tsx, DiffTrendChart.test.tsx). Mock fetch with vi.fn(); no real network.

Acceptance criteria
  • New file test/components/AccountToggle.test.tsx
  • Each case above covered; tests query by role/label, not CSS classes
主要言語
TypeScript
スター
246
フォーク
436
平均マージ
9時間 33分
マージ済み PR(30日)
213

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Priyanshu-byte-coder/devtrack のほかの issue

Priyanshu-byte-coder/devtrack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。