kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Resolve errors reported by new linter rules and rename data-test to data-testid

Open MisRob opened this issue 7 months ago • 3 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Complexity: Low Target branch: testing-library-lint

Context

(1) https://github.com/learningequality/kolibri/pull/14579 (testing-library-lint branch) introduces two new linter rules for frontend tests.

  • tests-no-hardcoded-strings
  • tests-no-stubs

and related developer documentation.

(2) Data test IDs are inconsistend. Testing Library tests use data-testid and Vue Test Utils test use data-test. We'd like to use only data-testid.

The Change

A pull request to testing-library-lint branch that

(1) Fixes errors reported by running the two new lint rules as per developer guidance. (2) Renames all occurences of data-test in the codebase to data-testid. Cleans up configure({ testIdAttribute: 'data-test' }) and alike.

After all changes are done, linter and frontend tests must pass.

AI usage

None

MisRob avatar Apr 10 '26 18:04 MisRob

Plan: Fix lint violations from two new ESLint rules (tests-no-hardcoded-strings, tests-no-stubs) and standardize all test ID attributes from data-test to data-testid.

  • [ ] Verify branch and baseline
  • [ ] Bulk rename data-test attribute in all Vue and JS files
  • [ ] Remove configure({ testIdAttribute: ... }) overrides
  • [ ] Get the exact list of violations
  • [ ] Fix each stubs violation
  • [ ] Get the exact list of violations
  • [ ] Fix each hardcoded-string violation
  • [ ] Concrete fixes for known tricky violations
  • [ ] Commit Phase 3 fixes

status


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
  • Ran the project's full test suite and linter before committing
  • For UI changes: captured live screenshots to verify rendering
  • For backend changes: verified with example API/CLI output

rtibblesbot avatar Apr 10 '26 18:04 rtibblesbot

@rtibblesbot sounds good, feel free to begin. Refer to the developer documentation updates in the aforementioned PR for guidance on how to fix lint errors.

MisRob avatar Apr 11 '26 05:04 MisRob

Closing in favor of https://github.com/learningequality/kolibri/issues/14599 (data-test part resolved by https://github.com/learningequality/kolibri/pull/14594)

MisRob avatar Apr 14 '26 04:04 MisRob