Migrate Device transfer modal tests to Vue Testing Library#14563
Migrate Device transfer modal tests to Vue Testing Library#14563soaebhasan12 wants to merge 5 commits intolearningequality:developfrom
Conversation
|
👋 Hi @soaebhasan12, thanks for contributing! For the review process to begin, please verify that the following is satisfied:
Also check that issue requirements are satisfied & you ran Pull requests that don't follow the guidelines will be closed. Reviewer assignment can take up to 2 weeks. |
|
|
closed by mistake... |
|
📢✨ Before we assign a reviewer, we'll turn on |
rtibblesbot
left a comment
There was a problem hiding this comment.
Clean migration — both files are free of @vue/test-utils, tests use semantic VTL queries, and the pattern matches CoreMenuOption.spec.js. CI is mostly pending but no failures.
- suggestion: count-only radio assertion in
SelectDriveModal(see inline) - suggestion: two removed tests leave a coverage gap for the primary selection interaction
- praise:
getByRole('button', { name: 'Continue' })+toBeDisabled()is good; stubs inSelectTransferSourceModalare well-reasoned
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
Reviewed the pull request diff checking for:
- Correctness: bugs, edge cases, undocumented behavior, resource leaks, hardcoded values
- Design: unnecessary complexity, naming, readability, comment accuracy, redundant state
- Architecture: duplicated concerns, minimal interfaces, composition over inheritance
- Testing: behavior-based assertions, mocks only at hard boundaries, accurate coverage
- Completeness: missing dependencies, unupdated usages, i18n, accessibility, security
- Principles: DRY (same reason to change), SRP, Rule of Three (no premature abstraction)
- Checked CI status and linked issue acceptance criteria
- For UI changes: inspected screenshots for layout, visual completeness, and consistency
kolibri/plugins/device/frontend/views/__tests__/SelectDriveModal.spec.js
Outdated
Show resolved
Hide resolved
kolibri/plugins/device/frontend/views/__tests__/SelectDriveModal.spec.js
Outdated
Show resolved
Hide resolved
kolibri/plugins/device/frontend/views/__tests__/SelectDriveModal.spec.js
Show resolved
Hide resolved
kolibri/plugins/device/frontend/views/__tests__/SelectTransferSourceModal.spec.js
Show resolved
Hide resolved
Build Artifacts
Smoke test screenshot |
rtibblesbot
left a comment
There was a problem hiding this comment.
No new code changes since the prior review — only a develop merge commit that doesn't touch the test files. Re-raising two unaddressed suggestions below.
CI passing.
Prior findings
Unaddressed (re-raised below):
- Radio count doesn't verify which drives are shown (suggestion) — no reply, no code change
- Two coverage gaps: "Continue" enabled on selection, "Cancel" event (suggestion) — no reply, no code change
0/2 prior suggestions resolved. 2 re-raised below.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
Compared the current PR state against findings from a prior review:
- Retrieved prior bot reviews deterministically via the GitHub API
- Classified each prior finding as RESOLVED, UNADDRESSED, ACKNOWLEDGED, or CONTESTED
- Only raised NEW findings for newly introduced code
- Reviewed the pull request diff checking for correctness, design, architecture, testing, completeness, and adherence to DRY/SRP principles
- Checked CI status and linked issue acceptance criteria
- For UI changes: inspected screenshots for layout, visual completeness, and consistency
kolibri/plugins/device/frontend/views/__tests__/SelectDriveModal.spec.js
Outdated
Show resolved
Hide resolved
kolibri/plugins/device/frontend/views/__tests__/SelectDriveModal.spec.js
Outdated
Show resolved
Hide resolved
rtibblesbot
left a comment
There was a problem hiding this comment.
Prior suggestions addressed; one nitpick on the new commit.
CI passing. Phase 3 skipped — no UI files changed.
Prior findings
N prior findings unchanged (2 from initial review, still resolved).
Newly resolved:
- Radio count doesn't verify which drives are shown (suggestion) ← was UNADDRESSED —
getByTextassertion added atSelectDriveModal.spec.js:77 - Missing test for drive-selected enables Continue (suggestion) ← was UNADDRESSED — test added at
SelectDriveModal.spec.js:131
2/2 prior findings resolved. 0 re-raised below.
Findings:
- 1 nitpick (inline)
- 1 praise (inline)
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
Compared the current PR state against findings from a prior review:
- Retrieved prior bot reviews deterministically via the GitHub API
- Classified each prior finding as RESOLVED, UNADDRESSED, ACKNOWLEDGED, or CONTESTED
- Only raised NEW findings for newly introduced code
- Reviewed the pull request diff checking for correctness, design, architecture, testing, completeness, and adherence to DRY/SRP principles
- Checked CI status and linked issue acceptance criteria
Summary
Migrated two test files from
@vue/test-utilsto Vue Testing Libraryas described in issue #14263:
SelectDriveModal.spec.js— 9 tests migratedSelectTransferSourceModal.spec.js— 2 tests migratedChanges made:
mountwithrenderfrom@testing-library/vue(
getByText,queryByText,getAllByRole,getByRole,getByTestId)@vue/test-utilsimportsmakeWrapperasrenderComponentfollowing the patternin
CoreMenuOption.spec.jsVerified all tests pass:
References
Closes #14263
Reviewer guidance
Run the following command to verify all tests pass:
The main files changed are:
kolibri/plugins/device/frontend/views/__tests__/SelectDriveModal.spec.jskolibri/plugins/device/frontend/views/__tests__/SelectTransferSourceModal.spec.jsNo other files were modified.
AI usage
I used Claude (AI assistant) to support this contribution.
Disclose: I used Claude to understand Vue Testing Library concepts
and the difference between
@vue/test-utilsand VTL patterns.Engage critically: I did not use AI output directly. For each test,
I analyzed what the original test was asserting, then chose the
appropriate VTL query based on Testing Library's query priority
guidelines. For example:
getAllByRole('radio')instead of CSS selectors to count drivesgetByRole('button', { name: 'Continue' })instead offind('button[name="submit"]')getByTextfor visible text assertions instead ofcomponent-internal checks
Edit: I removed
makeWrapper,getElements, and unnecessary stubs.I also discovered that passing the Vuex store directly via
store:option worked correctly, while
global: { plugins: [store] }did not— I debugged this by reading error messages and testing different
approaches.
Process sharing: I referenced
CoreMenuOption.spec.jsas thepattern guide mentioned in the issue, and used Claude to clarify
concepts when stuck. All final decisions on test structure and
assertions were made by me after reading the Testing Library docs.
I reviewed every test carefully to make sure it reflects real user
interactions — for example, using
getByTextto find visible textinstead of CSS classes, and
getByRole('button')instead offind('button[name="submit"]').I ran the full test suite to verify nothing was broken.