-
-
Notifications
You must be signed in to change notification settings - Fork 10
Feature/atcoder verified voting #3330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # AtCoder affiliation confirmation API endpoint (NoviSteps organization crawler) | ||
| # WARNING: Do NOT commit the actual endpoint URL. Set it in your local .env file. | ||
| # See team documentation for the actual URL. | ||
| CONFIRM_API_URL=https://your-confirm-api-endpoint.example.com/confirm |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,7 +28,13 @@ export const voteAbsoluteGrade = async ({ | |||||||||||
| }); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| if (!locals.user?.is_validated) { | ||||||||||||
| if (!locals.user) { | ||||||||||||
| return fail(INTERNAL_SERVER_ERROR, { | ||||||||||||
| message: 'ユーザー情報の取得に失敗しました。', | ||||||||||||
|
Comment on lines
+32
to
+33
|
||||||||||||
| return fail(INTERNAL_SERVER_ERROR, { | |
| message: 'ユーザー情報の取得に失敗しました。', | |
| await locals.auth.setSession(null); | |
| return fail(UNAUTHORIZED, { | |
| message: 'ユーザー情報の取得に失敗しました。再度ログインしてください。', |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,7 +20,7 @@ | |||||||||||||||||
|
|
||||||||||||||||||
| let { data } = $props(); | ||||||||||||||||||
|
|
||||||||||||||||||
| let taskResults: TaskResults = $derived(data.taskResults.sort(compareByContestIdAndTaskId)); | ||||||||||||||||||
| const taskResults: TaskResults = $derived(data.taskResults.sort(compareByContestIdAndTaskId)); | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 23 の 修正案(非破壊ソート)- const taskResults: TaskResults = $derived(data.taskResults.sort(compareByContestIdAndTaskId));
+ const taskResults: TaskResults = $derived(
+ [...data.taskResults].sort(compareByContestIdAndTaskId)
+ );📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||
| const taskResults: TaskResults = $derived(data.taskResults.sort(compareByContestIdAndTaskId)); | |
| const taskResults: TaskResults = $derived( | |
| data.taskResults.toSorted(compareByContestIdAndTaskId), | |
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Playwright公式ドキュメントで、expect(locator).toBeChecked() は options.checked を使って true/false の両状態検証をサポートしていますか?推奨されるトグル反転アサーション例も確認してください。💡 Result:
はい、Playwright公式ドキュメントによると、expect(locator).toBeCheckedはoptions.checkedを使ってtrue/falseの両状態を検証できます。デフォルトではchecked(true)を期待しますが、options.checked: falseを指定するとunchecked状態を検証します。また、indeterminate状態もサポートされていますが、checkedオプションとは併用不可です。 推奨されるトグル反転アサーション例: - チェック状態確認: await expect(locator).toBeChecked; - アンチェック状態確認: await expect(locator).not.toBeChecked; または await expect(locator).toBeChecked({ checked: false }); - トグル例(公式風): await locator.check; // または click await expect(locator).toBeChecked; await locator.uncheck; await expect(locator).not.toBeChecked; 公式ドキュメント(LocatorAssertions.toBeChecked)で明記されており、v1.18以降でoptions.checkedが追加されています。
Citations:
🏁 Script executed:
Repository: AtCoder-NoviSteps/AtCoderNoviSteps
Length of output: 133
🏁 Script executed:
Repository: AtCoder-NoviSteps/AtCoderNoviSteps
Length of output: 880
🏁 Script executed:
Repository: AtCoder-NoviSteps/AtCoderNoviSteps
Length of output: 368
トグル検証の一方向性が、実装パターンと乖離しており修正が必要です。
ガイド Line 85-87 の
await expect(toggleInput).toBeChecked();は、初期状態が ON の場合にクリック後 OFF へ遷移する正常系を検証できません。実装(
e2e/workbooks_list.spec.tsLine 198-200)では{ checked: !isChecked }で前状態の反転を検証しており、ガイドとの方針が異なります。Playwright 公式ドキュメント(v1.18 以降)もoptions.checkedでの両状態検証をサポートしているため、ガイドを実装パターンに合わせて修正してください。修正案
📝 Committable suggestion
🤖 Prompt for AI Agents