Repository navigation
Conversation
Proposed outlines only, for review before tests are generated from them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add unit tests written to each file's @test outline, with the outlines revised to state the product owner's decisions. All nine files reach 100% unit line coverage. The code changes those decisions call for: - useProjectDisplay: completedTaskCount rounds down, so 10 tasks at 96% show 9/10 (15). - useProjectRole: a project-group POC gets lead-level access on projects, including managing contributors; the project detail and edit pages pass in the TDEI roles they already load (14). The effective-role comment now says a project role replaces the workspace role (13). - geojson: bboxToPolygon's Feature has properties {} (16); polygonToBbox and shapeToCenter throw for an empty outer ring (17). - Wizard storage: a restored AOI needs closed rings of at least 4 positions (18). - Custom imagery: malformed JSON reports "Custom imagery is not valid JSON." rather than the parser's own message (19). - Step config: each of the four steps must appear exactly once (20). - Create payload: blank instructions are sent as null (21). - Review step: the imagery status follows the validation result, passed in by the create page: Working, Not valid or Not provided (22). The Number of Tasks row is gone, since tasks are generated later (23). The payload and review tests stub the rich-text sanitizer, because DOMPurify does not work under happy-dom: it unwraps allowed tags and lets <script> through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unit tests for five components, written to their @test outlines, which now record the product owner's decisions: - AppSelect: Escape on an open list closes only the list, not an enclosing dialog such as AddContributorDialog's b-modal. The toggle is a combobox named with its current value; the list is a listbox of options with the selected one aria-selected, and the active option is referenced with aria-activedescendant. - Dashboard map: the spinner stays until the map has loaded, and a map that reports an error before its style loads shows the error instead of spinning. A failed map setup is retried for the next workspace. A container resize re-fits the view only until the user pans or zooms. - Review attribute diff: a noop action's header reads "unchanged". - Review details: an open changeset's Closed At (an Invalid Date that crashed formatting), a feedback with no due date (shown as 12/31/69) and any field with no value now show "N/A". - Feature image: no code change; the outline now says a new image expands the panel again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The product owner revised two decisions. - 15: the completed task count rounds to the nearest task. The API sends percent_completed rounded from the real counts, so the nearest task is exact for up to 100 tasks. Above that the count can be off, so it reads "About <done>/<total>". The project cards and the project page share one helper, completedTasksFromPercent, so they agree. - 22: while the custom imagery is still being validated, as right after reloading on the Review step, its status reads "Checking…". The create page passes its pending state to the review summary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unit tests for services/project-wizard-aoi.ts, project-wizard-tasks.ts, project-wizard.ts and projects.ts, written to their revised @test outlines, plus a composable test for the area step's upload warning. AOI upload (project-wizard-aoi.ts): - Malformed GeoJSON (a FeatureCollection without features, non-array coordinates, null features or positions) gives an upload message, never a TypeError (25). - A bare coordinate array is still rejected, now with a message that says so (26). - An untyped { coordinates } MultiPolygon keeps its largest polygon, like a typed one (27); a 3-point unclosed ring works in a MultiPolygon too (28). - The parser returns a warning when holes, other polygons or other features are dropped; the area step shows it as a warning, on its own line (29). - Coordinates outside lon +-180 / lat +-90 and zero-area rings are rejected (30). Task preview (project-wizard-tasks.ts): - normalizeTaskAreaSquareKilometers(NaN) gives the 0.45 default (31). - The preview lays the server's lat/lon grid and counts only the cells that meet the AOI, up to the server's 50 000 cap (32). A cell the AOI cuts into separate pieces counts once; the server counts each piece. - Remove simulateProjectWizardTaskGeneration and mock-project-wizard.ts (34). Clients: - ProjectWizardClientError wraps non-2xx responses with the Response (35). - createProject returns the API's status, else draft (36), reading only id (37). - Remove the unused listWorkspaceUsers (39) and ProjectWizardWorkspaceUser.id (24). - Correct the stale mapper-name comment (40); remove the mock projects branch, mock-workspace-projects.ts and its JSON (41); warn on an unknown task status (42). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bboxToPolygon now includes `properties: {}` (decision 16); the dashboard map
tests were written against the Feature without it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wizard keeps the status the API gives a new project (#36), so its saved progress now restores for any status the API returns, not only "draft". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An upload now keeps its largest polygon wherever it is: across a FeatureCollection's features, in a GeometryCollection, in an array of Features or nested under other keys, as a MultiPolygon already did. The warning counts the polygons and features left out. A polygon without three usable points is passed over when another is usable, and bare points and lines are rejected rather than read as an outline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Tasks tab now shows "About N tasks" under the task-size slider. The count files each boundary segment under the grid rows it crosses, so a row checks only its own segments: a 100,000-vertex boundary takes tens of milliseconds instead of most of a second, with the same counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 58 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI flagged 18 files with poor test coverage: the project wizard and projects services, their composables and storage,
util/geojson.ts,AppSelect, the dashboard map and three review panels. Each file now has@testoutline comments at the top, with unit tests written to them. Where the code disagreed with the outline, the code was fixed, so this PR also changes some behavior (listed below).Measured with #204's line-based coverage, total line coverage is 65% on this branch, up from 60.3% on
develop. This PR's own CI still usesdevelop's statement-based merge, which loses most unit-test hits, so its table reads 50%. #204 replaces that merge.Behavior changes
Review page
Dashboard map
AppSelectProjects
percent_completedarrives rounded. The project page still counts its loaded tasks exactly.Project wizard
TypeError.instructionsfield is optional.idand keeps the API'sstatus.bboxToPolygongives its Featureproperties: {}, and an empty ring throws.Removed
These were deleted instead of tested, because nothing uses them:
services/mock-project-wizard.tslistWorkspaceUsersVITE_USE_MOCK_WORKSPACE_PROJECTSflag, withservices/mock-workspace-projects.tsandmock-api/workspace-projects/Testing
signinandsmokeexpect port 3000, and the run used another port.review.spec.tsis timing-sensitive. It failed once in a full parallel run, and passed 10 of 10 on both this branch anddevelopwhen rerun under equal load.🤖 Generated with Claude Code