Open rylew1 opened 1 month ago
app
St.:grey_question: |
Category | Percentage | Covered / Total |
---|---|---|---|
π’ | Statements | 93.1% | 81/87 |
π’ | Branches | 82.35% | 14/17 |
π’ | Functions | 93.33% | 14/15 |
π’ | Lines | 93.59% | 73/78 |
16 tests passing in 5 suites.
Report generated by π§ͺjest coverage report action from 7eeaf44589f4cfeda83c5145667950e7e71af661
Also should this be in the nav? Not sure if in general we want the nav to just dynamically include all routes
Ticket
Resolves #236
Changes
Context for reviewers
Chose the
useFormState
method (instead of just assigning the server action function to theaction
attribute of the form) . I believe this is a little more clear to handle returned data and possibly validation errorsI did not tie into an actual API call - though we could add as a follow on maybe (as described here https://github.com/navapbc/template-application-nextjs/issues/116)
Believe we could use
useOptimistic
in the example to show, for example, showoptimisticName
immediately, then aserverActionReturnedName
when the server action completesthe example uses native
form
instead ofUSWDS
<Form>
. The USWDS<Form>
requires anonSubmit
handlerFor loading you might be able to tie in
useFormStatus
/pending
statehttps://github.com/navapbc/template-application-nextjs/assets/93001277/6c230d22-139a-405c-9c93-c3df1a2dddcd