Add unit test for useDemosWorkspaceLoader
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- testing
Direzione di ricerca
Inizia da lua-learning-website/src/hooks/useExamplesWorkspaceLoader.test.ts e confrontalo con src/hooks/useDemosWorkspaceLoader.ts. Aggiungi il file di test corrispondente in lua-learning-website/src/hooks/useDemosWorkspaceLoader.test.ts, coprendo la risoluzione, la pulizia dello stato pending, la protezione dai duplicati e l'annullamento allo smontaggio; esegui i test dell'hook per confermare la parità.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Background
PR #751 added src/hooks/useDemosWorkspaceLoader.ts as a near-verbatim parallel of useExamplesWorkspaceLoader.ts, but did not ship the corresponding test file. The reviewer flagged this as tech debt:
The parallel `useExamplesWorkspaceLoader.ts` has an accompanying `useExamplesWorkspaceLoader.test.ts`, but no equivalent `useDemosWorkspaceLoader.test.ts` was added. The code is a near-verbatim copy of the existing pattern so risk is low, but the test-value-parity with the template it was copied from isn't upheld.
Scope
Create lua-learning-website/src/hooks/useDemosWorkspaceLoader.test.ts mirroring useExamplesWorkspaceLoader.test.ts. Coverage should include:
- Loader resolves and appends the demos workspace to state
- Pending set has
demosremoved after resolution - Duplicate add is guarded (workspace already present)
- Cancellation on unmount
Files
- New:
lua-learning-website/src/hooks/useDemosWorkspaceLoader.test.ts - Template:
lua-learning-website/src/hooks/useExamplesWorkspaceLoader.test.ts
Also consider adding tests for demosFetcher.ts and createDemosWorkspace / fetchAndCreateDemosWorkspace in workspaceManagerHelpers.ts if the Examples counterparts have dedicated coverage.
Risk
Low — the code is a near-verbatim copy of a tested template. This is a test-parity tech-debt item, not a behavior fix.
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di jcollard/LuaInTheWeb
-
tech-debt
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
jcollard/LuaInTheWeb#690 ·
-
tech-debt
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
jcollard/LuaInTheWeb#590 ·
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
jcollard/LuaInTheWeb#518 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
jcollard/LuaInTheWeb#235 ·
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
jcollard/LuaInTheWeb#51 ·
Tutte le issue di jcollard/LuaInTheWeb
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
melgarafael/DeskcommCRM#1812 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
prisma/prisma-cli#309 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
gregwebs/pi-quota-dispatcher#26 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
openwatersio/slackwater.xyz#124 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-reported area/browser area/docs documentation good first issue hacktoberfest help wanted P2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 2 giorni