@capagents/forgeqe 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HOW_TO_USE.md +29 -2
- package/dist/docs-site/docs/index.html +35 -2
- package/dist/docs-site/docs/mobile/index.html +8 -0
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/forgeqe.js +1702 -1701
- package/dist/web/assets/Agent-CNIwgz9P.js +8 -0
- package/dist/web/assets/{ApiTests-CK0HqEH4.js → ApiTests-CuflKFaz.js} +3 -3
- package/dist/web/assets/Browse-D6cvDJW3.js +2 -0
- package/dist/web/assets/Chat-BwlScUXP.js +5 -0
- package/dist/web/assets/{CommandPalette-CkreEJ8R.js → CommandPalette-Dkb2OOQX.js} +1 -1
- package/dist/web/assets/{Compare-CgOfZofk.js → Compare-Esy5n-kR.js} +1 -1
- package/dist/web/assets/{Cost-Dl5-viu4.js → Cost-BIoJmbfg.js} +1 -1
- package/dist/web/assets/{Data-Bv2S5wkW.js → Data-3Q5bGxT5.js} +2 -2
- package/dist/web/assets/{Desktop-CifPwy5u.js → Desktop-CsEWht_F.js} +1 -1
- package/dist/web/assets/{DesktopReview-fpGdtU4r.js → DesktopReview-BUfM70Ju.js} +1 -1
- package/dist/web/assets/{Evidence-hOZDzfKt.js → Evidence-DEDtYoZr.js} +1 -1
- package/dist/web/assets/{Explore-c85VGE9Q.js → Explore-AXLdkUHT.js} +1 -1
- package/dist/web/assets/{Features-DXL_vSjn.js → Features-DcDbE20H.js} +1 -1
- package/dist/web/assets/{Flags-B7x2pDud.js → Flags-CSKvhaye.js} +1 -1
- package/dist/web/assets/{Flaky-BM3syqCt.js → Flaky-B48EUqK0.js} +1 -1
- package/dist/web/assets/{Impact-BUCh8OAI.js → Impact-BTLqgWf6.js} +2 -2
- package/dist/web/assets/{Jobs-B8sBDYRI.js → Jobs-C2UViADN.js} +2 -2
- package/dist/web/assets/KindPage-DBWC-d0o.js +6 -0
- package/dist/web/assets/{Migration-BOLN1duU.js → Migration-TR5UJVZD.js} +1 -1
- package/dist/web/assets/{Product-C0FeEaJg.js → Product-CDAzt1hG.js} +1 -1
- package/dist/web/assets/{Production-BSMQyWKd.js → Production-sUNlZeSF.js} +1 -1
- package/dist/web/assets/{Quality-DsM9gWZb.js → Quality-C9Z0FYjK.js} +1 -1
- package/dist/web/assets/{Readiness-BhqkAJYN.js → Readiness-Qse6Oxo-.js} +1 -1
- package/dist/web/assets/Record-BPd38INk.js +2 -0
- package/dist/web/assets/{Regression-BXbX46nO.js → Regression-Brk_1yqk.js} +3 -3
- package/dist/web/assets/{RelationGraph-eoGXXz5t.js → RelationGraph-CV8NXesZ.js} +1 -1
- package/dist/web/assets/{Reports-36YQzVhA.js → Reports-C4U0fIue.js} +1 -1
- package/dist/web/assets/{Response-DplUOsue.js → Response-B1iCzkHo.js} +3 -3
- package/dist/web/assets/{RunDiff-D0fDhRmK.js → RunDiff-DUREV_nk.js} +1 -1
- package/dist/web/assets/{Runs-Bv1Ef8zq.js → Runs-B--vjy7q.js} +2 -2
- package/dist/web/assets/{Steps-Cm-atRtk.js → Steps-Bt1rmBc3.js} +1 -1
- package/dist/web/assets/{TestCases-B9x9W3zJ.js → TestCases-CVSJIPFl.js} +1 -1
- package/dist/web/assets/{TestData-DsJ6Z2YI.js → TestData-_sZDpddH.js} +1 -1
- package/dist/web/assets/{TestDebt-B_FUbMOb.js → TestDebt-D5NgM75J.js} +1 -1
- package/dist/web/assets/{Tosca-nxVCubA5.js → Tosca-BcfNYUdZ.js} +2 -2
- package/dist/web/assets/{WhatsNew-CdnbMvrr.js → WhatsNew-BtwiaM4Q.js} +1 -1
- package/dist/web/assets/{agentLink-BGKAF6xd.js → agentLink-BD93RYQ0.js} +1 -1
- package/dist/web/assets/{dataParts-Bn-tzbKg.js → dataParts-CxOVAp8R.js} +1 -1
- package/dist/web/assets/{families-DPlFfKf2.js → families-BLmK1isi.js} +1 -1
- package/dist/web/assets/filters-YzD0tZES.js +1 -0
- package/dist/web/assets/{fold-BhRpA0sy.js → fold-GeY4MiIu.js} +1 -1
- package/dist/web/assets/frame-CaTNV7DF.js +18 -0
- package/dist/web/assets/index-9ELkRoKH.js +67 -0
- package/dist/web/assets/index-B_mKjNAi.css +2 -0
- package/dist/web/assets/{logos-839CfoKx.js → logos-COH9UQgY.js} +1 -1
- package/dist/web/assets/{markdown-6z0km3hN.js → markdown-DoF5NaZz.js} +1 -1
- package/dist/web/assets/{paletteCommands-CZFdKGhh.js → paletteCommands-BlCwQKjX.js} +1 -1
- package/dist/web/assets/{parts-VPcxh6Jc.js → parts-Bx4MyFXM.js} +1 -1
- package/dist/web/assets/{productParts-BjfWgMtq.js → productParts-DTtbe-g-.js} +1 -1
- package/dist/web/assets/{qualityParts-PGN65yfI.js → qualityParts-DbH_PNDs.js} +1 -1
- package/dist/web/assets/{recordTest-EkxSMWbe.js → recordTest-Brs1Sw9O.js} +1 -1
- package/dist/web/assets/{rows-uLoguIo5.js → rows-vliRYT-Z.js} +1 -1
- package/dist/web/assets/{segmented-DphDskQz.js → segmented-Bisag9SK.js} +1 -1
- package/dist/web/assets/{usePageChat-DqEwGcyO.js → usePageChat-B-4sWqvn.js} +1 -1
- package/dist/web/index.html +5 -5
- package/docs/MOBILE.md +9 -0
- package/docs/user-guide.html +35 -2
- package/forgeqe.example.yaml +2 -0
- package/package.json +1 -1
- package/prompts/brain.md +3 -2
- package/prompts/talk-summary.md +1 -1
- package/prompts/talk.md +24 -5
- package/prompts/test-agent.md +1 -1
- package/py/forgeqe_voice/worker.py +78 -3
- package/dist/web/assets/Agent-DISh0THc.js +0 -8
- package/dist/web/assets/Browse-WylAQZvD.js +0 -2
- package/dist/web/assets/Chat-B7IOg3I3.js +0 -5
- package/dist/web/assets/KindPage-yVmpQm7L.js +0 -6
- package/dist/web/assets/Record-CPx-lK53.js +0 -2
- package/dist/web/assets/filters-Bj5K1WaL.js +0 -1
- package/dist/web/assets/frame-D_TPoUTD.js +0 -16
- package/dist/web/assets/index-BRB-oAMd.js +0 -67
- package/dist/web/assets/index-CIw5WfL8.css +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$n as e,C as t,D as n,Ir as r,Lr as i,Nn as a,Pr as o,Q as s,T as c,a as l,it as u,jr as d,ln as f,mr as p,tt as m,yt as h}from"./line-icons-DBwNPSmu.js";import{B as g,H as _,V as v,a as y,c as b,ct as x,en as S,ft as C,g as w,l as T,o as E,p as D,t as O,z as k}from"./filters-
|
|
1
|
+
import{$n as e,C as t,D as n,Ir as r,Lr as i,Nn as a,Pr as o,Q as s,T as c,a as l,it as u,jr as d,ln as f,mr as p,tt as m,yt as h}from"./line-icons-DBwNPSmu.js";import{B as g,H as _,V as v,a as y,c as b,ct as x,en as S,ft as C,g as w,l as T,o as E,p as D,t as O,z as k}from"./filters-YzD0tZES.js";import{B as A,G as j,H as M,U as ee,V as N,r as P,t as F,tt as I,un as te,z as ne}from"./frame-CaTNV7DF.js";import{r as L}from"./index-9ELkRoKH.js";import{n as re}from"./segmented-Bisag9SK.js";import{a as ie,c as R,f as z,i as B,n as V,o as H,r as U,s as W,t as G,u as K}from"./dataParts-CxOVAp8R.js";var q=r({Requests:()=>Q,TestData:()=>$}),J=i(o(),1),Y=S(),X=[`requests`,`kept`,`specs`,`batches`],Z={fetch:`kept`,request:`requests`,gen:`specs`,files:`specs`,insert:`specs`,batches:`batches`,clean:`batches`},ae=e=>Object.values(e.row_counts||{}).reduce((e,t)=>e+t,0);function oe({e,kept:t,busy:n,act:r}){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 px-1 py-2`,children:[(0,Y.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-[13px]`,children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:`Asked for`}),(0,Y.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:e.need}),(0,Y.jsx)(`dt`,{className:`text-muted`,children:`When`}),(0,Y.jsxs)(`dd`,{className:`m-0`,children:[new Date(e.at).toLocaleString(),e.ms===void 0?``:` · answered in ${(e.ms/1e3).toFixed(1)} s`]}),(0,Y.jsx)(`dt`,{className:`text-muted`,children:`How`}),(0,Y.jsxs)(`dd`,{className:`m-0`,children:[e.source===`fetch`?`A kept request fetched again, with no model`:`Asked the DB agent for ${e.asked===`existing`?`existing rows`:e.asked===`new`?`new rows`:`either`}`,e.name?(0,Y.jsxs)(Y.Fragment,{children:[` · `,(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.name})]}):null]}),e.why&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:`The answer`}),(0,Y.jsx)(`dd`,{className:`m-0`,children:e.why})]})]}),e.error&&(0,Y.jsx)(R,{text:e.error}),Object.entries(e.sample||{}).map(([t,n])=>(0,Y.jsx)(K,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:`The query`}),(0,Y.jsx)(V,{label:`SQL`,children:e.sql})]}),e.script_preview?.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script`}),(0,Y.jsx)(V,{label:`INSERT script`,children:e.script_preview.join(`
|
|
2
2
|
`)})]}):null,t&&e.name&&(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(k,{size:`sm`,disabled:n,onClick:()=>r(`fetch`,{name:e.name}),"data-tip":`Fetch again`,children:[(0,Y.jsx)(a,{"aria-hidden":`true`}),`Refresh`]})})]})}function Q({view:e,log:t,busy:r,act:i}){let[a,o]=(0,J.useState)(`all`),[s,l]=(0,J.useState)(``),[u,d]=(0,J.useState)(``),[p,m]=(0,J.useState)(``),_=t??[],y=(0,J.useMemo)(()=>[...new Set(_.map(e=>e.requester))].sort(),[t]),x=(0,J.useMemo)(()=>[...new Set(_.map(e=>e.database).filter(Boolean))].sort(),[t]),S=_.filter(e=>!e.ok).length,C=_.filter(e=>(a===`all`||a===`ok`===e.ok)&&(!s||e.requester===s)&&(!u||e.database===u)),w=new Set(e.requests.map(e=>e.name));return t===null?(0,Y.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading the requests…`}):_.length?(0,Y.jsx)(ne,{label:`Requests`,resetKey:`${a}|${s}|${u}`,minWidth:760,fixed:!0,placeholder:`Find a request`,tools:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(O,{value:a,onChange:o,items:[{id:`all`,label:`All`,n:_.length},{id:`ok`,label:`Answered`,n:_.length-S},{id:`failed`,label:`Failed`,n:S,alert:!0}]}),y.length>1&&(0,Y.jsxs)(E,{size:`sm`,"aria-label":`Who asked`,value:s,onChange:e=>l(e.target.value),className:`w-[180px]`,children:[(0,Y.jsx)(`option`,{value:``,children:`Anyone`}),y.map(e=>(0,Y.jsx)(`option`,{children:e},e))]}),x.length>1&&(0,Y.jsxs)(E,{size:`sm`,"aria-label":`Database`,value:u,onChange:e=>d(e.target.value),className:`w-[160px]`,children:[(0,Y.jsx)(`option`,{value:``,children:`Any database`}),x.map(e=>(0,Y.jsx)(`option`,{children:e},e))]})]}),head:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`th`,{className:v(M,`w-9`),children:(0,Y.jsx)(`span`,{className:`sr-only`,children:`Open`})}),(0,Y.jsx)(`th`,{className:v(M,`w-[110px]`),children:`When`}),(0,Y.jsx)(`th`,{className:v(M,`w-[150px]`),children:`Who asked`}),(0,Y.jsx)(`th`,{className:M,children:`What for`}),(0,Y.jsx)(`th`,{className:v(M,`w-[110px]`),children:`Database`}),(0,Y.jsx)(`th`,{className:v(M,`w-[140px]`),children:`Answer`}),(0,Y.jsx)(`th`,{className:v(ee,`w-[70px]`),children:`Rows`})]}),empty:`No requests match these filters. Pick All and Anyone to see every request.`,children:C.map(e=>{let t=p===e.id;return(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsxs)(`tr`,{className:v(j,t&&`bg-surface-muted`),onClick:()=>m(t?``:e.id),children:[(0,Y.jsx)(`td`,{className:v(A,`pr-0`),children:(0,Y.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":t?`Close the request`:`Open the request`,onClick:n=>(n.stopPropagation(),m(t?``:e.id)),className:`flex cursor-pointer items-center border-0 bg-transparent p-0 text-muted`,children:t?(0,Y.jsx)(c,{size:16,"aria-hidden":`true`}):(0,Y.jsx)(n,{size:16,"aria-hidden":`true`})})}),(0,Y.jsx)(`td`,{className:v(A,`whitespace-nowrap text-muted`),"data-tip":new Date(e.at).toLocaleString(),children:L(e.at)}),(0,Y.jsx)(`td`,{className:v(A,`truncate`),"data-tip":e.requester,children:e.requester}),(0,Y.jsxs)(`td`,{className:v(A,`truncate`),"data-tip":e.need,children:[e.need,e.source===`fetch`?(0,Y.jsx)(`span`,{className:`text-muted`,children:` · fetched again`}):null]}),(0,Y.jsx)(`td`,{className:v(A,`truncate`),"data-tip":e.database,children:e.database||(0,Y.jsx)(`span`,{className:`text-muted`,children:`—`})}),(0,Y.jsx)(`td`,{className:v(A,`whitespace-nowrap`),children:(0,Y.jsx)(b,{tone:e.ok?`pass`:`fail`,children:e.ok?H[e.kind||``]||`Answered`:`Failed`})}),(0,Y.jsx)(`td`,{className:N,children:e.ok?ae(e):``})]}),t&&(0,Y.jsx)(`tr`,{className:`border-t border-line-soft bg-surface-muted/40`,children:(0,Y.jsx)(`td`,{colSpan:7,className:`max-w-0 px-4 py-2`,children:(0,Y.jsx)(oe,{e,kept:!!e.name&&w.has(e.name),busy:r,act:i})})})]},e.id)})}):(0,Y.jsx)(T,{icon:h,title:`No test data asked for yet`,action:(0,Y.jsxs)(`a`,{href:D(`data`,`ask`,`test-data`),"data-tip":`Ask for test data`,className:v(g({size:`sm`}),`no-underline`),children:[(0,Y.jsx)(f,{"aria-hidden":`true`}),`Ask`]}),children:`The agents ask before a test runs, or you can ask yourself.`})}function se({view:e,job:t,busy:n,act:r,onNote:i}){let o=t&&!t.running&&t.kind===`fetch`?t:null,s=o?.result;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsx)(`p`,{className:`m-0 max-w-measure text-sm leading-relaxed text-ink-2`,children:`Each request is kept in test-data/requests with its query or INSERT script. Fetch one again to get the same data with no model: a query reads the rows there now, a spec makes the same rows.`}),o&&(0,Y.jsxs)(`section`,{"aria-label":`Fetched ${o.target}`,className:`flex flex-col gap-4 rounded-[14px] card border p-4`,children:[(0,Y.jsx)(`h2`,{className:`m-0 text-base font-semibold [overflow-wrap:anywhere]`,children:o.target}),s&&!s.ok&&(0,Y.jsx)(R,{text:s.error||`It could not fetch the data.`}),s?.ok&&(0,Y.jsx)(G,{r:s,onNote:i})]}),e.requests.length===0?(0,Y.jsxs)(T,{className:`py-4`,children:[`No kept requests yet. Each request the DB agent answers is kept here; `,(0,Y.jsx)(`a`,{href:D(`data`,`ask`,`test-data`),children:`ask for test data`}),` to make the first.`]}):(0,Y.jsx)(W,{items:e.requests,text:e=>`${e.need} ${e.name} ${e.database} ${e.requester||``}`,label:`Kept requests`,size:15,children:e=>(0,Y.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-4 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`text-[13px] font-medium [overflow-wrap:anywhere]`,children:e.need}),(0,Y.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[(0,Y.jsx)(`span`,{className:`font-mono`,children:e.name}),` · `,e.database,` · `,H[e.kind],e.rows?` · ${_(e.rows,`row`)}`:``,e.created?` · ${L(e.created)}`:``,e.requester?` · asked by ${e.requester}`:``]})]}),(0,Y.jsx)(k,{size:`icon`,variant:`icon`,disabled:n,onClick:()=>r(`fetch`,{name:e.name}),"aria-label":`Fetch ${e.name} again`,"data-tip":`Fetch ${e.name} again`,className:`size-8`,children:(0,Y.jsx)(a,{"aria-hidden":`true`})})]},e.name)})]})}function ce({view:e,job:t,busy:n,act:r,onNote:i}){let[a,o]=(0,J.useState)(e.specs[0]??``),[c,l]=(0,J.useState)(``),[p,g]=(0,J.useState)(``),[_,v]=(0,J.useState)(`csv`),[b,S]=(0,J.useState)(!1),C={spec:a,...c?{db:c}:{},...p?{seed:p}:{}},O=t&&!t.running?t:null,A=O&&[`gen`,`files`,`insert`].includes(O.kind)&&O.target===a?O.result:void 0,j=e.databases.find(e=>e.name===c),M=async()=>{try{let{id:e}=await x.start(`Write a test data spec for this project (a YAML file with tables: under test-data/), from the database's schema. Show me the spec and a preview before you save it.`,{});location.hash=D(`chats`,e)}catch(e){i(e.message)}};return(0,Y.jsxs)(`section`,{"aria-labelledby":`spec-h`,className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Y.jsxs)(`h2`,{id:`spec-h`,className:`m-0 flex flex-1 items-center gap-2 text-lg font-semibold`,children:[(0,Y.jsx)(w,{icon:h,size:18,className:`text-accent-fg`}),`Make test data from a spec`]}),(0,Y.jsxs)(k,{variant:`ghost`,onClick:()=>void M(),"data-tip":`Write a spec in a chat`,children:[(0,Y.jsx)(f,{"aria-hidden":`true`}),`Chat`]})]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-measure text-sm leading-relaxed text-ink-2`,children:`A spec is a YAML file with tables: and what goes in each column. The same spec and seed make the same data again, so a test or a pipeline can rely on it. No model is used.`}),e.specs.length===0?(0,Y.jsx)(T,{className:`py-4`,children:`No specs in this project yet: a YAML file with tables: in test-data/, data/ or specs/. Write one in a chat, from a database's schema.`}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-[14px] card border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-4`,children:[(0,Y.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-2 text-sm font-medium`,children:[`Spec`,(0,Y.jsx)(E,{value:a,onChange:e=>o(e.target.value),children:e.specs.map(e=>(0,Y.jsx)(`option`,{children:e},e))})]}),(0,Y.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-2 text-sm font-medium`,children:[`Database`,(0,Y.jsxs)(E,{value:c,onChange:e=>l(e.target.value),children:[(0,Y.jsx)(`option`,{value:``,children:`The spec's own`}),e.databases.map(e=>(0,Y.jsxs)(`option`,{value:e.name,children:[e.name,e.writable?``:` (read only)`]},e.name))]})]}),(0,Y.jsxs)(`label`,{className:`flex w-[120px] flex-col gap-2 text-sm font-medium`,children:[`Seed`,(0,Y.jsx)(y,{value:p,inputMode:`numeric`,placeholder:`Random`,onChange:e=>g(e.target.value.replace(/\D/g,``).slice(0,9))})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(k,{variant:b?void 0:`primary`,disabled:n||!a,onClick:()=>r(`gen`,C),children:[(0,Y.jsx)(u,{"aria-hidden":`true`}),`Preview`]}),(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Y.jsxs)(k,{disabled:n||!a,onClick:()=>r(`gen`,{...C,mode:`files`,format:_}),"data-tip":`Write files (${_})`,children:[(0,Y.jsx)(m,{"aria-hidden":`true`}),`Export`]}),(0,Y.jsx)(E,{"aria-label":`File format`,value:_,onChange:e=>v(e.target.value),className:`w-[88px]`,children:[`csv`,`json`,`sql`].map(e=>(0,Y.jsx)(`option`,{children:e},e))})]}),(0,Y.jsxs)(k,{disabled:n||!a||!j?.writable,"data-tip":j?.writable?`Insert into ${j.name}`:`Pick a writable database to insert into`,onClick:()=>S(!0),children:[(0,Y.jsx)(s,{"aria-hidden":`true`}),`Insert`]})]}),b&&j&&(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Insert test data`,className:`flex flex-col gap-4 rounded-[12px] border border-warn bg-warn-soft p-4`,children:[(0,Y.jsxs)(`span`,{className:`font-medium`,children:[`Insert the rows of `,a,` into `,j.name,`?`]}),(0,Y.jsx)(`span`,{className:`text-sm text-ink-2`,children:`They go in as one batch, which you can remove again under Batches. Only on a test database.`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(k,{variant:`primary`,onClick:()=>{S(!1),r(`gen`,{...C,mode:`insert`,confirmed:!0})},children:[(0,Y.jsx)(s,{"aria-hidden":`true`}),`Insert`]}),(0,Y.jsxs)(k,{onClick:()=>S(!1),"data-tip":`Don't insert`,children:[(0,Y.jsx)(d,{"aria-hidden":`true`}),`Cancel`]})]})]}),A&&!A.ok&&(0,Y.jsx)(R,{text:A.error||`It did not make the data.`}),A?.ok&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[A.batch&&(0,Y.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-4 py-2 text-sm text-pass`,children:[`Inserted as batch `,(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:A.batch}),`.`]}),A.files?.length?(0,Y.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Wrote`,A.files.map(e=>(0,Y.jsx)(U,{file:e,onNote:i},e))]}):null,(0,Y.jsx)(B,{r:A})]})]})]})}function le({view:n,job:r,busy:i,act:a}){let o=n.databases.filter(e=>e.writable),[s,c]=(0,J.useState)(o[0]?.name??``),[l,d]=(0,J.useState)(``),f=r&&!r.running?r:null,m=f?.kind===`batches`?(Array.isArray(f.result)?f.result.flatMap(e=>e.batches||[]):f.result?.batches)??[]:null;return(0,Y.jsxs)(`section`,{"aria-labelledby":`batch-h`,className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`h2`,{id:`batch-h`,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,Y.jsx)(w,{icon:e,size:18,className:`text-accent-fg`}),`Inserted batches`]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-measure text-sm leading-relaxed text-ink-2`,children:`Rows inserted from a spec go in as a batch. Remove a batch to take exactly those rows out again, children first.`}),o.length===0?(0,Y.jsx)(T,{className:`py-4`,children:`No writable database: test data is inserted only into one marked writable in Settings, Databases.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(E,{"aria-label":`Database`,value:s,onChange:e=>c(e.target.value),className:`w-[220px]`,children:o.map(e=>(0,Y.jsx)(`option`,{children:e.name},e.name))}),(0,Y.jsxs)(k,{disabled:i||!s,onClick:()=>a(`batches`,{db:s}),"data-tip":`List batches`,children:[(0,Y.jsx)(u,{"aria-hidden":`true`}),`Show`]})]}),m&&m.length===0&&(0,Y.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`No batches in `,f?.target,`.`]}),m&&m.length>0&&(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:m.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-4 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.batch}),(0,Y.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[(0,Y.jsx)(`span`,{"data-tip":new Date(e.created).toLocaleString(),children:L(e.created)}),e.spec?` · ${e.spec}`:``,` ·`,` `,Object.entries(e.rows).map(([e,t])=>`${e} ${t}`).join(`, `)]})]}),l===e.batch?(0,Y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Y.jsxs)(`span`,{className:`text-[13px] text-warn`,children:[`Remove its rows from `,f?.target,`?`]}),(0,Y.jsxs)(k,{variant:`danger`,size:`sm`,onClick:()=>{d(``),a(`clean`,{db:f?.target,batch:e.batch,confirmed:!0})},children:[(0,Y.jsx)(p,{"aria-hidden":`true`}),`Remove`]}),(0,Y.jsxs)(k,{size:`sm`,onClick:()=>d(``),children:[(0,Y.jsx)(t,{"aria-hidden":`true`}),`Keep`]})]}):(0,Y.jsx)(k,{size:`icon`,variant:`icon`,disabled:i,onClick:()=>d(e.batch),"aria-label":`Remove batch ${e.batch}`,"data-tip":`Remove batch ${e.batch}`,className:`size-8`,children:(0,Y.jsx)(p,{"aria-hidden":`true`})})]},e.batch))}),f?.kind===`clean`&&f.result?.ok&&(0,Y.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-4 py-2 text-sm text-pass`,children:[`Removed:`,` `,Object.entries(f.result.removed||{}).map(([e,t])=>`${e} ${t}`).join(`, `)]})]})]})}function $({sub:e}){let{view:t,error:n,busy:r,act:i,stop:a,job:o}=z(),[s,c]=(0,J.useState)(null),[u,d]=(0,J.useState)(``),p=X.includes(e)?e:`requests`,m=o&&!o.running?o.endedAt:``;(0,J.useEffect)(()=>{C.log().then(c,e=>d(e.message))},[m]);let h=(s||[]).filter(e=>!e.ok).length,y=new Set((s||[]).map(e=>e.requester)).size,b={requests:`Requests${s?` (${s.length})`:``}`,kept:`Kept${t?` (${t.requests.length})`:``}`,specs:`Specs${t?` (${t.specs.length})`:``}`,batches:`Batches`};return(0,Y.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,Y.jsx)(P,{}),(0,Y.jsxs)(`main`,{className:v(F,`@container flex-auto gap-4`),children:[(0,Y.jsxs)(`a`,{href:D(`data`,`databases`),className:`inline-flex w-fit items-center gap-2 text-sm`,children:[(0,Y.jsx)(l,{size:16,"aria-hidden":`true`}),`All databases`]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Y.jsx)(I,{pixel:te[`test-data`],size:`lg`}),(0,Y.jsx)(`h1`,{className:`m-0 flex-1 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test data`}),(0,Y.jsxs)(`a`,{href:D(`data`,`ask`,`test-data`),"data-tip":`Ask for test data`,className:v(g(),`no-underline`),children:[(0,Y.jsx)(f,{"aria-hidden":`true`}),`Ask`]})]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-measure text-sm leading-relaxed text-ink-2`,children:`Every request for test data: which agent asked, what for, when, and what the DB agent sent back. Kept requests fetch the same data again with no model; specs make data you can insert as batches and remove again.`}),s&&s.length>0&&(0,Y.jsxs)(`p`,{className:`m-0 text-sm text-ink-2 tabular-nums`,children:[_(s.length,`request`),` · `,_(y,`asker`),` · `,(0,Y.jsxs)(`span`,{className:h?`text-fail`:``,children:[h,` failed`]}),t?` · ${t.requests.length} kept`:``]}),(n||u)&&(0,Y.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:n||u}),!t&&!n&&(0,Y.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(re,{label:`Test data`,current:p,onPick:e=>location.hash=D(`test-data`,e),tabs:X.map(e=>({id:e,label:b[e]}))}),o&&(o.running?Z[o.kind]!==void 0:Z[o.kind]===p)&&(0,Y.jsx)(ie,{job:o,onStop:a}),(0,Y.jsxs)(`div`,{role:`tabpanel`,id:`panel-${p}`,"aria-labelledby":`tab-${p}`,children:[p===`requests`&&(0,Y.jsx)(Q,{view:t,log:s,busy:r,act:i}),p===`kept`&&(0,Y.jsx)(se,{view:t,job:o,busy:r,act:i,onNote:d}),p===`specs`&&(0,Y.jsx)(ce,{view:t,job:o,busy:r,act:i,onNote:d}),p===`batches`&&(0,Y.jsx)(le,{view:t,job:o,busy:r,act:i})]})]})]})]})}export{q as n,Q as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$t as e,J as t,L as n,Lr as r,M as i,Nn as ee,Pr as a,_r as o,j as s,o as c,rr as te,yr as ne}from"./line-icons-DBwNPSmu.js";import{B as l,V as u,a as re,ct as d,en as f,l as p,o as m,p as h,st as g,t as _,z as v}from"./filters-Bj5K1WaL.js";import{r as ie,t as ae,tt as oe,un as se,z as y}from"./frame-D_TPoUTD.js";import{r as b}from"./index-BRB-oAMd.js";import{_ as x,o as S}from"./qualityParts-PGN65yfI.js";var C=r(a(),1),w={view:()=>g(`GET`,`/api/testdebt`),refresh:()=>g(`POST`,`/api/testdebt/refresh`,{}),readCases:(e,t)=>g(`POST`,`/api/testdebt/cases`,{source:e,scope:t})},T=f(),E=[`untested`,`signal`,`duplicates`,`cases`],D={endpoint:`Endpoint`,screen:`Screen`,file:`Code file`},O={test:`Test`,recording:`Recording`,case:`Test case`},k={azure_devops:`Azure DevOps`,jira:`Jira`,xray:`Xray`,testrail:`TestRail`,zephyr:`Zephyr Scale`,qtest:`qTest`,other:`Other`},A={azure_devops:`plan=12/suite=34`,testrail:`run=7`,zephyr:`cycle=SHOP-R12`,qtest:`cycle=12`,xray:`plan=SHOP-100`},j=e=>`${Math.round(e*100)}%`,M=e=>E.includes(e)?e:`untested`;function N({part:e,what:t,action:n}){return(0,T.jsxs)(p,{icon:o,title:e.state===`empty`?`No ${t} yet`:`${t[0].toUpperCase()}${t.slice(1)}: not connected`,action:(0,T.jsxs)(`a`,{className:l({size:`sm`}),href:n.to,"data-tip":`Open ${n.label}`,children:[(0,T.jsx)(c,{"aria-hidden":`true`}),n.label]}),children:[`To see this list, set `,e.set,`.`]})}function P({text:e,tip:t}){return(0,T.jsx)(`span`,{"data-tip":t??e,className:`block truncate`,children:e})}function F({sub:r}){let[a,o]=(0,C.useState)(null),[f,g]=(0,C.useState)(``),[E,F]=(0,C.useState)(!1),[I,L]=(0,C.useState)(``),R=M(r),[z,B]=(0,C.useState)(`all`),[V,H]=(0,C.useState)(`manual`),[U,W]=(0,C.useState)(``),[G,K]=(0,C.useState)(``);(0,C.useEffect)(()=>{w.view().then(e=>{o(e),g(``)},e=>g(e.message))},[]);let q=(0,C.useCallback)(async(e,t)=>{F(!0),L(``);try{o(await e()),g(``),t&&L(t)}catch(e){g(e.message)}finally{F(!1)}},[]),ce=async e=>{if(e){F(!0);try{let{id:t}=await d.start(e,{});location.hash=h(`chats`,t)}catch(e){g(e.message),F(!1)}}},J=(e,t)=>(0,T.jsx)(v,{size:`icon`,variant:`icon`,className:`size-8`,disabled:E||!e,onClick:()=>void ce(e),"aria-label":`Draft a test for this ${t} in a chat`,"data-tip":e?`Draft a test for this ${t} in a chat`:`Its id or file is not of a plain shape, so no chat request names it: open it where it lives instead.`,children:(0,T.jsx)(te,{"aria-hidden":`true`})}),Y=a?.sources.filter(e=>e.connected&&e.id!==`jira`)??[],X=U||Y[0]?.id||``,Z=a?.cases.filter(e=>!e.automated).length??0,le=a?.areas.filter(e=>z===`all`||e.kind===z)??[],ue=a?.cases.filter(e=>V===`all`||(V===`manual`?!e.automated:e.automated))??[],Q=`py-2 pr-4 text-right tabular-nums`,$={untested:(a?.areas.length??0)+(a?.rules.length??0),signal:(a?.quiet.length??0)+(a?.gone.length??0),duplicates:a?.duplicates.length??0,cases:Z};return(0,T.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,T.jsx)(ie,{}),(0,T.jsxs)(`main`,{className:u(ae,`@container max-w-[1320px] flex-auto gap-4`),children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,T.jsx)(oe,{pixel:se[`test-debt`],size:`lg`}),(0,T.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test debt`}),a&&(0,T.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[13px] text-muted`,children:[(0,T.jsxs)(`span`,{"data-tip":x(a.at),children:[`Worked out `,b(a.at)]}),(0,T.jsxs)(v,{size:`sm`,disabled:E,onClick:()=>void q(w.refresh,`Worked out again.`),children:[(0,T.jsx)(ee,{"aria-hidden":`true`}),`Refresh`]})]})]}),(0,T.jsxs)(`p`,{className:`m-0 max-w-measure text-[13px] leading-relaxed text-ink-2`,children:[`What no test checks yet, and tests that tell little: code and business rules no test reaches in the `,(0,T.jsx)(`a`,{href:h(`product`),children:`product graph`}),`, tests that passed every one of their last 30 runs or whose file is gone from `,a?.repo&&a.repo!==`.`?(0,T.jsx)(`code`,{className:`font-mono text-[13px]`,children:a.repo}):`the test repository`,`, tests that read alike, and each test case with whether it is automated. It only reads; Draft the test asks in a chat, and nothing changes until you agree there.`]}),f&&(0,T.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:f}),!a&&!f&&(0,T.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),I&&(0,T.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2`,children:I}),a&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-6 @xl:divide-x @xl:divide-line-soft`,children:[(0,T.jsx)(S,{label:`Untested code`,value:a.graph.state===`ok`?a.areas.length:`–`,tone:a.areas.length?`text-warn`:void 0,sub:a.graph.state===`ok`?`of ${a.graph.checked} areas`:`graph not built`}),(0,T.jsx)(S,{label:`Untested rules`,value:a.rules.length,tone:a.rules.length?`text-warn`:void 0,sub:`of ${a.graph.rulesChecked} rules`}),(0,T.jsx)(S,{label:`Never fail`,value:a.quiet.length,sub:`30 passes in a row`}),(0,T.jsx)(S,{label:`Code gone`,value:a.gone.length,tone:a.gone.length?`text-fail`:void 0,sub:`of ${a.files.count} files listed`}),(0,T.jsx)(S,{label:`Near-duplicates`,value:a.duplicates.length,sub:`from ${j(a.threshold)} alike`}),(0,T.jsx)(S,{label:`Not automated`,value:Z,tone:Z?`text-warn`:void 0,sub:`of ${a.cases.length} test cases`})]}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,T.jsx)(_,{items:[{id:`untested`,label:`Untested code and rules`,n:$.untested},{id:`signal`,label:`Low-signal tests`,n:$.signal},{id:`duplicates`,label:`Near-duplicates`,n:$.duplicates},{id:`cases`,label:`Test cases`,n:$.cases}],value:R,onChange:e=>location.hash=h(`test-debt`,e)})}),a.notes.map(e=>(0,T.jsx)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:e},e)),R===`untested`&&(0,T.jsxs)(T.Fragment,{children:[a.graph.state===`ok`?(0,T.jsx)(y,{label:`Code no test reaches`,placeholder:`Find an endpoint, screen or file`,resetKey:z,empty:a.areas.length?`Nothing matches.`:`Every endpoint, screen and code file the graph holds is reached by a test.`,tools:(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,T.jsx)(_,{items:[{id:`all`,label:`All`,n:a.areas.length},...[`endpoint`,`screen`,`file`].map(e=>({id:e,label:`${D[e]}s`,n:a.areas.filter(t=>t.kind===e).length}))],value:z,onChange:B})}),head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[34%] py-2 pr-4 pl-4 font-medium`,children:`Code`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:`Kind`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @xl:table-cell`,children:`Where`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 text-right font-medium @2xl:table-cell`,children:`Used by`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:le.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4 pl-4`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(i,{size:15,"aria-label":`No test reaches it`,className:`flex-none text-warn`}),(0,T.jsx)(P,{text:e.name,tip:`${e.name} · ${e.known===`observed`?`read in the code`:`worked out from the code`}`})]})}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-[13px] whitespace-nowrap`,children:D[e.kind]}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-4 font-mono text-[13px] text-ink-2 @xl:table-cell`,children:(0,T.jsx)(P,{text:e.where})}),(0,T.jsx)(`td`,{className:u(Q,`hidden text-muted @2xl:table-cell`),children:e.users}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:J(e.draft,D[e.kind].toLowerCase())})]},e.id))}):(0,T.jsx)(N,{part:a.graph,what:`product graph`,action:{label:`Product`,to:h(`product`)}}),(0,T.jsx)(y,{label:`Business rules no test checks`,placeholder:`Find a rule`,empty:a.graph.rulesChecked?`Every business rule found is checked by a test.`:`No business rules found: the product graph's rules come from the code; the knowledge folder's from a business-rules.md file.`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[46%] py-2 pr-4 pl-4 font-medium`,children:`Rule`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:`From`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @xl:table-cell`,children:`Where`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @2xl:table-cell`,children:`Closest test`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.rules.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4 pl-4`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(i,{size:15,"aria-label":`No test checks it`,className:`flex-none text-warn`}),(0,T.jsx)(P,{text:e.text,tip:e.endpoint?`${e.text} · checked by ${e.endpoint}`:e.text})]})}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-[13px] whitespace-nowrap`,"data-tip":e.from===`graph`?`Found in the code by forgeqe knowledge build`:`A rule of the knowledge folder, matched to tests by its words`,children:e.from===`graph`?`Code`:`Knowledge`}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-4 font-mono text-[13px] text-ink-2 @xl:table-cell`,children:(0,T.jsx)(P,{text:e.where})}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-4 text-[13px] text-ink-2 @2xl:table-cell`,children:e.nearest?(0,T.jsx)(P,{text:`${e.nearest.name} (${j(e.nearest.score)})`,tip:`${j(e.nearest.score)} of the rule's words are in ${e.nearest.name}`}):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:J(e.draft,`rule`)})]},e.id))})]}),R===`signal`&&(a.history.state===`ok`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(y,{label:`Tests that never fail`,placeholder:`Find a test`,empty:`No test has passed 30 runs in a row without a failure or a retry.`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[50%] py-2 pr-4 pl-4 font-medium`,children:`Test`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 text-right font-medium`,children:`Passes`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @xl:table-cell`,children:`Since`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.quiet.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4 pl-4`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(s,{size:15,"aria-label":`Always passed`,className:`flex-none text-muted`}),(0,T.jsx)(P,{text:e.name,tip:e.file?`${e.name} · ${e.file}`:e.name})]})}),(0,T.jsx)(`td`,{className:u(Q,`text-muted`),children:e.runs}),(0,T.jsx)(`td`,{className:`hidden py-2 pr-4 text-[13px] whitespace-nowrap text-muted @xl:table-cell`,"data-tip":e.since?x(e.since):void 0,children:e.since?b(e.since):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:J(e.draft,`test`)})]},e.key))}),(0,T.jsx)(y,{label:`Tests whose file is gone`,placeholder:`Find a test or file`,empty:`Every test file the history names is in the test repository (${a.files.count} files, listed by ${a.files.by===`git`?`git`:`walking the folder`}).`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[40%] py-2 pr-4 pl-4 font-medium`,children:`Test`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:`File`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @xl:table-cell`,children:`Last run`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.gone.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4 pl-4`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(n,{size:15,"aria-label":`Its file is gone`,className:`flex-none text-fail`}),(0,T.jsx)(P,{text:e.name})]})}),(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4 font-mono text-[13px] text-ink-2`,children:(0,T.jsx)(P,{text:e.file})}),(0,T.jsx)(`td`,{className:`hidden py-2 pr-4 text-[13px] whitespace-nowrap text-muted @xl:table-cell`,"data-tip":e.last?x(e.last):void 0,children:e.last?b(e.last):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:J(e.draft,`test`)})]},e.key))})]}):(0,T.jsx)(N,{part:a.history,what:`test history`,action:{label:`Regression`,to:h(`regression`)}})),R===`duplicates`&&(0,T.jsx)(y,{label:`Tests that read alike`,placeholder:`Find a test, recording or case`,empty:`No two tests, recordings or test cases share ${j(a.threshold)} of their words (${a.compared} pairs compared).`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`py-2 pr-4 pl-4 text-right font-medium`,children:`Alike`}),(0,T.jsx)(`th`,{className:`w-[30%] py-2 pr-4 font-medium`,children:`First`}),(0,T.jsx)(`th`,{className:`w-[30%] py-2 pr-4 font-medium`,children:`Second`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @2xl:table-cell`,children:`Shared words`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.duplicates.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:u(Q,`pl-4`,e.score>=.85?`text-warn`:`text-muted`),children:(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,T.jsx)(t,{size:14,"aria-hidden":`true`}),j(e.score)]})}),[e.a,e.b].map((e,t)=>(0,T.jsxs)(`td`,{className:`max-w-0 py-2 pr-4`,children:[(0,T.jsx)(P,{text:e.name,tip:`${O[e.kind]}: ${e.name}${e.where?` · ${e.where}`:``}`}),(0,T.jsx)(`span`,{className:`block text-[13px] text-muted`,children:O[e.kind]})]},t)),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-4 text-[13px] text-ink-2 @2xl:table-cell`,children:(0,T.jsx)(P,{text:e.shared.join(`, `)})}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:J(e.draft,`pair`)})]},`${e.a.kind}:${e.a.key}|${e.b.kind}:${e.b.key}`))}),R===`cases`&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`span`,{className:`text-[13px] font-medium`,children:`Test management`}),(0,T.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:a.sources.map(e=>(0,T.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[e.connected?(0,T.jsx)(s,{size:15,"aria-label":`Connected`,className:`flex-none text-pass`}):(0,T.jsx)(i,{size:15,"aria-label":`Not connected`,className:`flex-none text-muted`}),(0,T.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,T.jsx)(`span`,{className:`text-ink-2`,children:e.connected?e.scopes.length?e.scopes.map(e=>`${e.scope}: ${e.cases} read ${b(e.at)}`).join(` · `):e.id===`jira`?`connected: its cases show once ForgeQE has indexed or automated them`:`connected`:`not connected: set ${e.set}`})]},e.id))})]}),Y.length>0&&(0,T.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),X&&q(()=>w.readCases(X,G.trim()),`Test cases read.`)},children:[(0,T.jsx)(m,{size:`sm`,"aria-label":`Source`,value:X,onChange:e=>W(e.target.value),children:Y.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,T.jsx)(re,{size:`sm`,"aria-label":`Scope`,placeholder:X&&X!==`jira`?A[X]:``,value:G,maxLength:80,onChange:e=>K(e.target.value),className:`w-full max-w-[240px] flex-[0_1_240px]`}),(0,T.jsxs)(v,{size:`sm`,type:`submit`,disabled:E||!G.trim(),"data-tip":`Read the test cases`,children:[(0,T.jsx)(ne,{"aria-hidden":`true`}),`Import`]})]}),a.cases.length?(0,T.jsx)(y,{label:`Test cases`,placeholder:`Find a test case by id or title`,resetKey:V,empty:`Nothing matches.`,tools:(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,T.jsx)(_,{items:[{id:`manual`,label:`Not automated`,n:Z,alert:!0},{id:`automated`,label:`Automated`,n:a.cases.length-Z},{id:`all`,label:`All`,n:a.cases.length}],value:V,onChange:H})}),head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`py-2 pr-4 pl-4 font-medium`,children:`Case`}),(0,T.jsx)(`th`,{className:`w-[36%] py-2 pr-4 font-medium`,children:`Title`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @xl:table-cell`,children:`Source`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:`Automated`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @2xl:table-cell`,children:`Test`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:ue.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`py-2 pr-4 pl-4 font-mono text-[13px] whitespace-nowrap`,children:/^https?:\/\//i.test(e.url)?(0,T.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id}):e.id}),(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4`,children:(0,T.jsx)(P,{text:e.title||`–`})}),(0,T.jsx)(`td`,{className:`hidden py-2 pr-4 text-[13px] whitespace-nowrap @xl:table-cell`,"data-tip":`From ${e.scope}`,children:k[e.source]}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-[13px] whitespace-nowrap`,children:(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2`,"data-tip":e.how===`mapping`?`Its test is in the automated tests' mapping`:e.how===`name`?`A test in the history names its id`:`No automated test names it`,children:[e.automated?(0,T.jsx)(s,{size:15,"aria-hidden":`true`,className:`text-pass`}):(0,T.jsx)(i,{size:15,"aria-hidden":`true`,className:`text-muted`}),e.automated?`Yes`:`No`]})}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-4 text-[13px] text-ink-2 @2xl:table-cell`,children:e.test?(0,T.jsx)(P,{text:e.test,tip:e.file?`${e.test} · ${e.file}`:e.test}):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:!e.automated&&J(e.draft,`test case`)})]},`${e.source}|${e.id}`))}):(0,T.jsx)(p,{icon:e,title:`No test cases yet`,action:(0,T.jsxs)(`a`,{className:l({size:`sm`}),href:h(`settings`,`integrations`),"data-tip":`Open Settings, Integrations`,children:[(0,T.jsx)(c,{"aria-hidden":`true`}),`Settings`]}),children:`Test cases show here from ForgeQE's case index, the automated tests' mapping (.forgeqe/test-cases.json), and the plans, runs or cycles you read above from a connected source.`})]})]})]})]})}export{F as TestDebt};
|
|
1
|
+
import{$t as e,J as t,L as n,Lr as r,M as i,Nn as ee,Pr as a,_r as o,j as s,o as c,rr as te,yr as ne}from"./line-icons-DBwNPSmu.js";import{B as l,V as u,a as re,ct as d,en as f,l as p,o as m,p as h,st as g,t as _,z as v}from"./filters-YzD0tZES.js";import{r as ie,t as ae,tt as oe,un as se,z as y}from"./frame-CaTNV7DF.js";import{r as b}from"./index-9ELkRoKH.js";import{_ as x,o as S}from"./qualityParts-DbH_PNDs.js";var C=r(a(),1),w={view:()=>g(`GET`,`/api/testdebt`),refresh:()=>g(`POST`,`/api/testdebt/refresh`,{}),readCases:(e,t)=>g(`POST`,`/api/testdebt/cases`,{source:e,scope:t})},T=f(),E=[`untested`,`signal`,`duplicates`,`cases`],D={endpoint:`Endpoint`,screen:`Screen`,file:`Code file`},O={test:`Test`,recording:`Recording`,case:`Test case`},k={azure_devops:`Azure DevOps`,jira:`Jira`,xray:`Xray`,testrail:`TestRail`,zephyr:`Zephyr Scale`,qtest:`qTest`,other:`Other`},A={azure_devops:`plan=12/suite=34`,testrail:`run=7`,zephyr:`cycle=SHOP-R12`,qtest:`cycle=12`,xray:`plan=SHOP-100`},j=e=>`${Math.round(e*100)}%`,M=e=>E.includes(e)?e:`untested`;function N({part:e,what:t,action:n}){return(0,T.jsxs)(p,{icon:o,title:e.state===`empty`?`No ${t} yet`:`${t[0].toUpperCase()}${t.slice(1)}: not connected`,action:(0,T.jsxs)(`a`,{className:l({size:`sm`}),href:n.to,"data-tip":`Open ${n.label}`,children:[(0,T.jsx)(c,{"aria-hidden":`true`}),n.label]}),children:[`To see this list, set `,e.set,`.`]})}function P({text:e,tip:t}){return(0,T.jsx)(`span`,{"data-tip":t??e,className:`block truncate`,children:e})}function F({sub:r}){let[a,o]=(0,C.useState)(null),[f,g]=(0,C.useState)(``),[E,F]=(0,C.useState)(!1),[I,L]=(0,C.useState)(``),R=M(r),[z,B]=(0,C.useState)(`all`),[V,H]=(0,C.useState)(`manual`),[U,W]=(0,C.useState)(``),[G,K]=(0,C.useState)(``);(0,C.useEffect)(()=>{w.view().then(e=>{o(e),g(``)},e=>g(e.message))},[]);let q=(0,C.useCallback)(async(e,t)=>{F(!0),L(``);try{o(await e()),g(``),t&&L(t)}catch(e){g(e.message)}finally{F(!1)}},[]),ce=async e=>{if(e){F(!0);try{let{id:t}=await d.start(e,{});location.hash=h(`chats`,t)}catch(e){g(e.message),F(!1)}}},J=(e,t)=>(0,T.jsx)(v,{size:`icon`,variant:`icon`,className:`size-8`,disabled:E||!e,onClick:()=>void ce(e),"aria-label":`Draft a test for this ${t} in a chat`,"data-tip":e?`Draft a test for this ${t} in a chat`:`Its id or file is not of a plain shape, so no chat request names it: open it where it lives instead.`,children:(0,T.jsx)(te,{"aria-hidden":`true`})}),Y=a?.sources.filter(e=>e.connected&&e.id!==`jira`)??[],X=U||Y[0]?.id||``,Z=a?.cases.filter(e=>!e.automated).length??0,le=a?.areas.filter(e=>z===`all`||e.kind===z)??[],ue=a?.cases.filter(e=>V===`all`||(V===`manual`?!e.automated:e.automated))??[],Q=`py-2 pr-4 text-right tabular-nums`,$={untested:(a?.areas.length??0)+(a?.rules.length??0),signal:(a?.quiet.length??0)+(a?.gone.length??0),duplicates:a?.duplicates.length??0,cases:Z};return(0,T.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,T.jsx)(ie,{}),(0,T.jsxs)(`main`,{className:u(ae,`@container max-w-[1320px] flex-auto gap-4`),children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,T.jsx)(oe,{pixel:se[`test-debt`],size:`lg`}),(0,T.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test debt`}),a&&(0,T.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[13px] text-muted`,children:[(0,T.jsxs)(`span`,{"data-tip":x(a.at),children:[`Worked out `,b(a.at)]}),(0,T.jsxs)(v,{size:`sm`,disabled:E,onClick:()=>void q(w.refresh,`Worked out again.`),children:[(0,T.jsx)(ee,{"aria-hidden":`true`}),`Refresh`]})]})]}),(0,T.jsxs)(`p`,{className:`m-0 max-w-measure text-[13px] leading-relaxed text-ink-2`,children:[`What no test checks yet, and tests that tell little: code and business rules no test reaches in the `,(0,T.jsx)(`a`,{href:h(`product`),children:`product graph`}),`, tests that passed every one of their last 30 runs or whose file is gone from `,a?.repo&&a.repo!==`.`?(0,T.jsx)(`code`,{className:`font-mono text-[13px]`,children:a.repo}):`the test repository`,`, tests that read alike, and each test case with whether it is automated. It only reads; Draft the test asks in a chat, and nothing changes until you agree there.`]}),f&&(0,T.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:f}),!a&&!f&&(0,T.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),I&&(0,T.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2`,children:I}),a&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-6 @xl:divide-x @xl:divide-line-soft`,children:[(0,T.jsx)(S,{label:`Untested code`,value:a.graph.state===`ok`?a.areas.length:`–`,tone:a.areas.length?`text-warn`:void 0,sub:a.graph.state===`ok`?`of ${a.graph.checked} areas`:`graph not built`}),(0,T.jsx)(S,{label:`Untested rules`,value:a.rules.length,tone:a.rules.length?`text-warn`:void 0,sub:`of ${a.graph.rulesChecked} rules`}),(0,T.jsx)(S,{label:`Never fail`,value:a.quiet.length,sub:`30 passes in a row`}),(0,T.jsx)(S,{label:`Code gone`,value:a.gone.length,tone:a.gone.length?`text-fail`:void 0,sub:`of ${a.files.count} files listed`}),(0,T.jsx)(S,{label:`Near-duplicates`,value:a.duplicates.length,sub:`from ${j(a.threshold)} alike`}),(0,T.jsx)(S,{label:`Not automated`,value:Z,tone:Z?`text-warn`:void 0,sub:`of ${a.cases.length} test cases`})]}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,T.jsx)(_,{items:[{id:`untested`,label:`Untested code and rules`,n:$.untested},{id:`signal`,label:`Low-signal tests`,n:$.signal},{id:`duplicates`,label:`Near-duplicates`,n:$.duplicates},{id:`cases`,label:`Test cases`,n:$.cases}],value:R,onChange:e=>location.hash=h(`test-debt`,e)})}),a.notes.map(e=>(0,T.jsx)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:e},e)),R===`untested`&&(0,T.jsxs)(T.Fragment,{children:[a.graph.state===`ok`?(0,T.jsx)(y,{label:`Code no test reaches`,placeholder:`Find an endpoint, screen or file`,resetKey:z,empty:a.areas.length?`Nothing matches.`:`Every endpoint, screen and code file the graph holds is reached by a test.`,tools:(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,T.jsx)(_,{items:[{id:`all`,label:`All`,n:a.areas.length},...[`endpoint`,`screen`,`file`].map(e=>({id:e,label:`${D[e]}s`,n:a.areas.filter(t=>t.kind===e).length}))],value:z,onChange:B})}),head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[34%] py-2 pr-4 pl-4 font-medium`,children:`Code`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:`Kind`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @xl:table-cell`,children:`Where`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 text-right font-medium @2xl:table-cell`,children:`Used by`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:le.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4 pl-4`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(i,{size:15,"aria-label":`No test reaches it`,className:`flex-none text-warn`}),(0,T.jsx)(P,{text:e.name,tip:`${e.name} · ${e.known===`observed`?`read in the code`:`worked out from the code`}`})]})}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-[13px] whitespace-nowrap`,children:D[e.kind]}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-4 font-mono text-[13px] text-ink-2 @xl:table-cell`,children:(0,T.jsx)(P,{text:e.where})}),(0,T.jsx)(`td`,{className:u(Q,`hidden text-muted @2xl:table-cell`),children:e.users}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:J(e.draft,D[e.kind].toLowerCase())})]},e.id))}):(0,T.jsx)(N,{part:a.graph,what:`product graph`,action:{label:`Product`,to:h(`product`)}}),(0,T.jsx)(y,{label:`Business rules no test checks`,placeholder:`Find a rule`,empty:a.graph.rulesChecked?`Every business rule found is checked by a test.`:`No business rules found: the product graph's rules come from the code; the knowledge folder's from a business-rules.md file.`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[46%] py-2 pr-4 pl-4 font-medium`,children:`Rule`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:`From`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @xl:table-cell`,children:`Where`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @2xl:table-cell`,children:`Closest test`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.rules.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4 pl-4`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(i,{size:15,"aria-label":`No test checks it`,className:`flex-none text-warn`}),(0,T.jsx)(P,{text:e.text,tip:e.endpoint?`${e.text} · checked by ${e.endpoint}`:e.text})]})}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-[13px] whitespace-nowrap`,"data-tip":e.from===`graph`?`Found in the code by forgeqe knowledge build`:`A rule of the knowledge folder, matched to tests by its words`,children:e.from===`graph`?`Code`:`Knowledge`}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-4 font-mono text-[13px] text-ink-2 @xl:table-cell`,children:(0,T.jsx)(P,{text:e.where})}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-4 text-[13px] text-ink-2 @2xl:table-cell`,children:e.nearest?(0,T.jsx)(P,{text:`${e.nearest.name} (${j(e.nearest.score)})`,tip:`${j(e.nearest.score)} of the rule's words are in ${e.nearest.name}`}):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:J(e.draft,`rule`)})]},e.id))})]}),R===`signal`&&(a.history.state===`ok`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(y,{label:`Tests that never fail`,placeholder:`Find a test`,empty:`No test has passed 30 runs in a row without a failure or a retry.`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[50%] py-2 pr-4 pl-4 font-medium`,children:`Test`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 text-right font-medium`,children:`Passes`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @xl:table-cell`,children:`Since`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.quiet.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4 pl-4`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(s,{size:15,"aria-label":`Always passed`,className:`flex-none text-muted`}),(0,T.jsx)(P,{text:e.name,tip:e.file?`${e.name} · ${e.file}`:e.name})]})}),(0,T.jsx)(`td`,{className:u(Q,`text-muted`),children:e.runs}),(0,T.jsx)(`td`,{className:`hidden py-2 pr-4 text-[13px] whitespace-nowrap text-muted @xl:table-cell`,"data-tip":e.since?x(e.since):void 0,children:e.since?b(e.since):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:J(e.draft,`test`)})]},e.key))}),(0,T.jsx)(y,{label:`Tests whose file is gone`,placeholder:`Find a test or file`,empty:`Every test file the history names is in the test repository (${a.files.count} files, listed by ${a.files.by===`git`?`git`:`walking the folder`}).`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[40%] py-2 pr-4 pl-4 font-medium`,children:`Test`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:`File`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @xl:table-cell`,children:`Last run`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.gone.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4 pl-4`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(n,{size:15,"aria-label":`Its file is gone`,className:`flex-none text-fail`}),(0,T.jsx)(P,{text:e.name})]})}),(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4 font-mono text-[13px] text-ink-2`,children:(0,T.jsx)(P,{text:e.file})}),(0,T.jsx)(`td`,{className:`hidden py-2 pr-4 text-[13px] whitespace-nowrap text-muted @xl:table-cell`,"data-tip":e.last?x(e.last):void 0,children:e.last?b(e.last):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:J(e.draft,`test`)})]},e.key))})]}):(0,T.jsx)(N,{part:a.history,what:`test history`,action:{label:`Regression`,to:h(`regression`)}})),R===`duplicates`&&(0,T.jsx)(y,{label:`Tests that read alike`,placeholder:`Find a test, recording or case`,empty:`No two tests, recordings or test cases share ${j(a.threshold)} of their words (${a.compared} pairs compared).`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`py-2 pr-4 pl-4 text-right font-medium`,children:`Alike`}),(0,T.jsx)(`th`,{className:`w-[30%] py-2 pr-4 font-medium`,children:`First`}),(0,T.jsx)(`th`,{className:`w-[30%] py-2 pr-4 font-medium`,children:`Second`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @2xl:table-cell`,children:`Shared words`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.duplicates.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:u(Q,`pl-4`,e.score>=.85?`text-warn`:`text-muted`),children:(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,T.jsx)(t,{size:14,"aria-hidden":`true`}),j(e.score)]})}),[e.a,e.b].map((e,t)=>(0,T.jsxs)(`td`,{className:`max-w-0 py-2 pr-4`,children:[(0,T.jsx)(P,{text:e.name,tip:`${O[e.kind]}: ${e.name}${e.where?` · ${e.where}`:``}`}),(0,T.jsx)(`span`,{className:`block text-[13px] text-muted`,children:O[e.kind]})]},t)),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-4 text-[13px] text-ink-2 @2xl:table-cell`,children:(0,T.jsx)(P,{text:e.shared.join(`, `)})}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:J(e.draft,`pair`)})]},`${e.a.kind}:${e.a.key}|${e.b.kind}:${e.b.key}`))}),R===`cases`&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`span`,{className:`text-[13px] font-medium`,children:`Test management`}),(0,T.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:a.sources.map(e=>(0,T.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[e.connected?(0,T.jsx)(s,{size:15,"aria-label":`Connected`,className:`flex-none text-pass`}):(0,T.jsx)(i,{size:15,"aria-label":`Not connected`,className:`flex-none text-muted`}),(0,T.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,T.jsx)(`span`,{className:`text-ink-2`,children:e.connected?e.scopes.length?e.scopes.map(e=>`${e.scope}: ${e.cases} read ${b(e.at)}`).join(` · `):e.id===`jira`?`connected: its cases show once ForgeQE has indexed or automated them`:`connected`:`not connected: set ${e.set}`})]},e.id))})]}),Y.length>0&&(0,T.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),X&&q(()=>w.readCases(X,G.trim()),`Test cases read.`)},children:[(0,T.jsx)(m,{size:`sm`,"aria-label":`Source`,value:X,onChange:e=>W(e.target.value),children:Y.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,T.jsx)(re,{size:`sm`,"aria-label":`Scope`,placeholder:X&&X!==`jira`?A[X]:``,value:G,maxLength:80,onChange:e=>K(e.target.value),className:`w-full max-w-[240px] flex-[0_1_240px]`}),(0,T.jsxs)(v,{size:`sm`,type:`submit`,disabled:E||!G.trim(),"data-tip":`Read the test cases`,children:[(0,T.jsx)(ne,{"aria-hidden":`true`}),`Import`]})]}),a.cases.length?(0,T.jsx)(y,{label:`Test cases`,placeholder:`Find a test case by id or title`,resetKey:V,empty:`Nothing matches.`,tools:(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,T.jsx)(_,{items:[{id:`manual`,label:`Not automated`,n:Z,alert:!0},{id:`automated`,label:`Automated`,n:a.cases.length-Z},{id:`all`,label:`All`,n:a.cases.length}],value:V,onChange:H})}),head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`py-2 pr-4 pl-4 font-medium`,children:`Case`}),(0,T.jsx)(`th`,{className:`w-[36%] py-2 pr-4 font-medium`,children:`Title`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @xl:table-cell`,children:`Source`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:`Automated`}),(0,T.jsx)(`th`,{className:`hidden py-2 pr-4 font-medium @2xl:table-cell`,children:`Test`}),(0,T.jsx)(`th`,{className:`py-2 pr-4 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:ue.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`py-2 pr-4 pl-4 font-mono text-[13px] whitespace-nowrap`,children:/^https?:\/\//i.test(e.url)?(0,T.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id}):e.id}),(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-4`,children:(0,T.jsx)(P,{text:e.title||`–`})}),(0,T.jsx)(`td`,{className:`hidden py-2 pr-4 text-[13px] whitespace-nowrap @xl:table-cell`,"data-tip":`From ${e.scope}`,children:k[e.source]}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-[13px] whitespace-nowrap`,children:(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2`,"data-tip":e.how===`mapping`?`Its test is in the automated tests' mapping`:e.how===`name`?`A test in the history names its id`:`No automated test names it`,children:[e.automated?(0,T.jsx)(s,{size:15,"aria-hidden":`true`,className:`text-pass`}):(0,T.jsx)(i,{size:15,"aria-hidden":`true`,className:`text-muted`}),e.automated?`Yes`:`No`]})}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-4 text-[13px] text-ink-2 @2xl:table-cell`,children:e.test?(0,T.jsx)(P,{text:e.test,tip:e.file?`${e.test} · ${e.file}`:e.test}):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-4 text-right whitespace-nowrap`,children:!e.automated&&J(e.draft,`test case`)})]},`${e.source}|${e.id}`))}):(0,T.jsx)(p,{icon:e,title:`No test cases yet`,action:(0,T.jsxs)(`a`,{className:l({size:`sm`}),href:h(`settings`,`integrations`),"data-tip":`Open Settings, Integrations`,children:[(0,T.jsx)(c,{"aria-hidden":`true`}),`Settings`]}),children:`Test cases show here from ForgeQE's case index, the automated tests' mapping (.forgeqe/test-cases.json), and the plans, runs or cycles you read above from a connected source.`})]})]})]})]})}export{F as TestDebt};
|