learningequality / learningequality/kolibri

Improve `showExamsPage` test suite

Open
#11,615 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

TAG: tech update / debt
Dominant language
Python
Stars
1.1k
Forks
972
Avg merge
7d 16h
Merged PRs (30d)
33

Description

After the newest updates of showExamsPage handler (https://github.com/learningequality/kolibri/pull/11570), its test suite started failing due to problems with set up. I needed to dig deep into various nested store actions to understand and locate several places that needed to be mocked. After seeing that there are even more places to be mocked after a significant period of time I spent on it, I gave up and disabled tests temporarily here https://github.com/learningequality/kolibri/pull/11570/commits/ff7a7baf34208edf97d192f6a2b5bd9f28bcd9e1. In my humble opinion, we need to re-design tests to

  • Stop relying on internal Vuex store structure
  • Be designed clearly so future updates are straightforward and not time-consuming
  • Overall have more clarity about what's the purpose and dependencies of those tests

As we're moving towards composition API, this could be done as part of that work. The logic of this handler could be refactored to stop relying on Vuex for storing data whenever appropriate. When testing, we'd only feed the composable with some input and tested its output.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the showExamsPage handler and the tests disabled in PR #11570 at commit ff7a7baf34208edf97d192f6a2b5bd9f28bcd9e1. Trace the nested Vuex store actions and the handler's dependencies before deciding how composition API work could isolate inputs and outputs. Done means the tests are re-enabled, avoid relying on internal Vuex structure, and clearly document their purpose and dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, testing
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.