Add tests for board rendering, drag and drop, and settings toggles
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 72/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript
- Bereich
- testing
Rechercherichtung
Start with tests/ and the existing test setup, then read the referenced sections of js/utils.js, js/board.js, js/drag.js, and js/main.js. Run npm test and npm run lint to see current conventions and coverage. Add tests for each listed behavior and make the drag handlers importable; done when the acceptance criteria pass.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
Drag and drop is the default input method and the most recently changed area, yet it has no automated check. js/drag.js has no CommonJS export and js/main.js is a single DOMContentLoaded handler, so neither can be loaded by the current tests.
Where
js/drag.js:285-288(onlywindow.initDragAndDropis exposed),js/drag.js:186-283js/main.js:7-80js/board.js:13,js/board.js:39,js/board.js:99,js/board.js:153js/utils.js:10-27,js/utils.js:60-82
Suggested fix
-
utils:algebraicToCoordsreturnsnullfor'i1','a9','a0','',null,'e44'and accepts'E4';coordsToAlgebraic(8,0)and(-1,0)returnnull;isWithinBoundsat 0, 7, -1, 8 -
deepClone: a nested board clone is independent of the source -
board:createBoardmakes 64 squares withdata-rowanddata-col;renderPiecesplaces 32 pieces at the start;updateBoardVisualsmarks the selected square, the possible moves and the king in check -
handleBoardClickEvent: a click on a piece inside a square selects it; it is ignored whilewindow.dragJustEndedis true -
drag: export the handlers for tests; mousedown, mousemove, mouseup over a legal square callsmakeMoveonce; a drop on an illegal square or outside the board leaves the position unchanged and clears the selection; mousedown without movement falls through to click selection (#23) -
main: toggles read and write their storage keys with the documented defaults - Optional: one browser smoke test, since jsdom has no layout for
elementsFromPoint
Acceptance criteria
-
drag.jshandlers are importable in tests - Each item above has a test
Getting started
- Relevant files:
js/drag.js,js/board.js,js/main.js,js/utils.js,tests/ - How to run tests:
npm install, thennpm testandnpm run lint - Related docs:
docs/ARCHITECTURE.md,.github/CONTRIBUTING.md
Filed by repo-audit/full-audit at 8a2c86c. Severity: low. Effort: M. audit-key: testing|js/drag.js|handleDragEnd
- Vorherrschende Sprache
- JavaScript
- Sterne
- 4
- Forks
- 2
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TMHSDigital/Static_Chess
-
enhancement good first issue severity: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TMHSDigital/Static_Chess#53 ·
-
documentation good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
TMHSDigital/Static_Chess#49 ·
-
documentation good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
TMHSDigital/Static_Chess#48 ·
-
documentation severity: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TMHSDigital/Static_Chess#47 ·
-
documentation good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
TMHSDigital/Static_Chess#46 ·
Alle Issues in TMHSDigital/Static_Chess
Ähnliche Issues
-
good first issue tests
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
growilabs/growi#12246 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
TMHSDigital/Free-Game-Dev-Assets#301 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100