@capagents/forgeqe 3.0.9 → 3.1.0
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 +1 -1
- package/bin/bundle.js +3 -3
- package/bin/forgeqe.js +3 -3
- package/bin/license.js +1 -1
- package/dist/docs-site/CREDITS.md +11 -4
- package/dist/docs-site/LICENSE.dm-sans.txt +93 -0
- package/dist/docs-site/LICENSE.jetbrains-mono.txt +93 -0
- package/dist/docs-site/app-look.css +62 -0
- package/dist/docs-site/architecture-map/arch-fill.js +56 -0
- package/dist/docs-site/architecture-map/arch-theme.css +203 -0
- package/dist/docs-site/architecture-map/arch.css +0 -5
- package/dist/docs-site/architecture-map/index.html +57 -43
- package/dist/docs-site/docs/app-theme.css +166 -0
- package/dist/docs-site/docs/architecture/index.html +14 -11
- package/dist/docs-site/docs/containers/index.html +14 -11
- package/dist/docs-site/docs/cost-architecture/index.html +14 -11
- package/dist/docs-site/docs/custom-agents-first-run/index.html +14 -11
- package/dist/docs-site/docs/desktop/index.html +14 -11
- package/dist/docs-site/docs/desktop-ci/index.html +14 -11
- package/dist/docs-site/docs/docs.css +0 -7
- package/dist/docs-site/docs/evidence/index.html +14 -11
- package/dist/docs-site/docs/feature-test-prompts/index.html +14 -11
- package/dist/docs-site/docs/graphify/index.html +14 -11
- package/dist/docs-site/docs/guardrails/index.html +14 -11
- package/dist/docs-site/docs/index.html +71 -36
- package/dist/docs-site/docs/mobile/index.html +56 -18
- package/dist/docs-site/docs/model-routing/index.html +14 -11
- package/dist/docs-site/docs/product-graph/index.html +14 -11
- package/dist/docs-site/docs/product-knowledge/index.html +14 -11
- package/dist/docs-site/docs/product-views/index.html +14 -11
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/docs-site/docs/web-app/index.html +14 -11
- package/dist/docs-site/img/wordmark.webp +0 -0
- package/dist/docs-site/site-header.css +0 -5
- package/dist/forgeqe.js +1784 -1784
- package/dist/template.html +14 -14
- package/dist/web/assets/{AgentWork-BhepbEeU.js → AgentWork-C3KdZh5M.js} +1 -1
- package/dist/web/assets/ApiTests-BLnl7JGO.js +10 -0
- package/dist/web/assets/Browse-C-Enjpmd.js +2 -0
- package/dist/web/assets/Chat-Bt6jZI68.js +3 -0
- package/dist/web/assets/Choices-D5eTFinz.js +3 -0
- package/dist/web/assets/{CommandPalette-DMAmXPq1.js → CommandPalette-D89NM2_E.js} +1 -1
- package/dist/web/assets/{Compare-DJNSrM2v.js → Compare-YfFYHwfK.js} +1 -1
- package/dist/web/assets/Cost-ClaDz0YR.js +1 -0
- package/dist/web/assets/{Data-COFRpcJn.js → Data-jSFgAfej.js} +4 -4
- package/dist/web/assets/Desktop-BofKeLVf.js +1 -0
- package/dist/web/assets/DesktopReview--WjeZh3w.js +1 -0
- package/dist/web/assets/Evidence-CJNzSQpY.js +1 -0
- package/dist/web/assets/{Explore-DDXgQj5Q.js → Explore-BdFvqgF4.js} +2 -2
- package/dist/web/assets/{Features-BM5iXhOR.js → Features-CIBbw6PG.js} +1 -1
- package/dist/web/assets/Flags-B62v4uWR.js +2 -0
- package/dist/web/assets/{Flaky-BqUHVLao.js → Flaky-Cut1kZw6.js} +1 -1
- package/dist/web/assets/{Impact-CA6s3POt.js → Impact-jOSl5Q0k.js} +3 -3
- package/dist/web/assets/{Jobs-B59p1qvn.js → Jobs-DMJGgWtQ.js} +2 -2
- package/dist/web/assets/KindPage-BbQWH5wa.js +6 -0
- package/dist/web/assets/{Migration-DtynahwR.js → Migration-BBgv7xXo.js} +2 -2
- package/dist/web/assets/PageAgent-txbNoP6u.js +1 -0
- package/dist/web/assets/{Product-wWMz2Nnk.js → Product-BrXH81Ns.js} +3 -3
- package/dist/web/assets/Production-CCVtFNGQ.js +1 -0
- package/dist/web/assets/Quality-Dxh-60A8.js +1 -0
- package/dist/web/assets/Readiness-DyJvSOLN.js +1 -0
- package/dist/web/assets/Record-Dnlkimjb.js +1 -0
- package/dist/web/assets/Regression-D2DDTwzs.js +5 -0
- package/dist/web/assets/{Reports-C-NSlVAn.js → Reports-ClcY7M0Q.js} +2 -2
- package/dist/web/assets/Response-D9FYUvHg.js +9 -0
- package/dist/web/assets/RunDiff-CNImaEdz.js +1 -0
- package/dist/web/assets/{Runs-DIDCOhbK.js → Runs-CFvmdULI.js} +2 -2
- package/dist/web/assets/{Steps-BOWDBzu4.js → Steps-BS66s0E1.js} +1 -1
- package/dist/web/assets/TestCases-CrQEUtfD.js +1 -0
- package/dist/web/assets/{TestData-kXWCn7uZ.js → TestData-e3IX0xwG.js} +2 -2
- package/dist/web/assets/TestDebt-tXPoexMF.js +1 -0
- package/dist/web/assets/TestManagement-wjGaoZzI.js +1 -0
- package/dist/web/assets/{Tosca-dhFuqYxV.js → Tosca-C5YaMLS0.js} +2 -2
- package/dist/web/assets/{WhatsNew-DpJWNec7.js → WhatsNew-CwnRbDnd.js} +1 -1
- package/dist/web/assets/azuredevops-BcQ5AFOM.js +1 -0
- package/dist/web/assets/crew-CWfjZIxE.js +1 -0
- package/dist/web/assets/{fold-BRxvbN9r.js → fold-tvLGnxD1.js} +1 -1
- package/dist/web/assets/frame-Deu1IqzV.js +13 -0
- package/dist/web/assets/index-BWMIKyPB.js +76 -0
- package/dist/web/assets/index-C2Yq55oT.css +2 -0
- package/dist/web/assets/logos-C1NBtBMc.js +1 -0
- package/dist/web/assets/logos-DFyhMw0i.js +1 -0
- package/dist/web/assets/{markdown-CWisJbSJ.js → markdown-DC2HA0yZ.js} +1 -1
- package/dist/web/assets/paletteCommands-Qxm5DZIs.js +1 -0
- package/dist/web/assets/parts-BR6dUwqn.js +1 -0
- package/dist/web/assets/qualityParts-lz6eYVxC.js +1 -0
- package/dist/web/assets/today-DuQFapJM.js +1 -0
- package/dist/web/assets/when-CHnpLdYw.js +1 -0
- package/dist/web/index.html +10 -4
- package/docs/ForgeQE-Client-Overview.pdf +0 -0
- package/docs/ForgeQE-Installation-Guide.pdf +0 -0
- package/docs/MOBILE.md +42 -7
- package/docs/user-guide.html +1 -1
- package/package.json +1 -1
- package/prompts/brain.md +1 -0
- package/py/forgeqe_data/connect.py +3 -1
- package/py/forgeqe_data/flows.py +1 -1
- package/py/forgeqe_data/service.py +1 -1
- package/py/forgeqe_data/streams.py +1 -1
- package/py/forgeqe_data/testdata.py +1 -1
- package/py/forgeqe_desktop/replay.py +43 -1
- package/py/forgeqe_desktop/service.py +2 -0
- package/py/forgeqe_desktop/workflow.py +77 -15
- package/py/forgeqe_engine/brand.py +1 -1
- package/py/forgeqe_engine/browser.py +2 -1
- package/py/forgeqe_engine/diagnostics.py +1 -1
- package/py/forgeqe_engine/memory.py +2 -1
- package/py/forgeqe_engine/neutral_log.py +1 -1
- package/py/forgeqe_engine/otp.py +127 -12
- package/py/forgeqe_engine/pwlaunch.mjs +1 -1
- package/py/forgeqe_engine/recordsession.py +13 -3
- package/py/forgeqe_engine/webrecord.py +20 -0
- package/py/forgeqe_mobile/appium_driver.py +225 -10
- package/py/forgeqe_mobile/locators.py +277 -0
- package/py/forgeqe_mobile/maestro.py +28 -1
- package/py/forgeqe_mobile/magiclink.py +79 -0
- package/py/forgeqe_mobile/record.py +284 -67
- package/py/forgeqe_mobile/service.py +9 -0
- package/py/forgeqe_mobile/webview.py +142 -0
- package/py/forgeqe_tosca/ntir.py +45 -6
- package/dist/docs-site/LICENSE.ubuntu.txt +0 -96
- package/dist/docs-site/img/icons/api.svg +0 -1
- package/dist/docs-site/img/icons/architecture.svg +0 -1
- package/dist/docs-site/img/icons/branch.svg +0 -1
- package/dist/docs-site/img/icons/browser-agent.svg +0 -1
- package/dist/docs-site/img/icons/case.svg +0 -1
- package/dist/docs-site/img/icons/container.svg +0 -1
- package/dist/docs-site/img/icons/context-engine.svg +0 -1
- package/dist/docs-site/img/icons/desktop.svg +0 -1
- package/dist/docs-site/img/icons/download.svg +0 -1
- package/dist/docs-site/img/icons/explorer.svg +0 -1
- package/dist/docs-site/img/icons/feature.svg +0 -1
- package/dist/docs-site/img/icons/healer.svg +0 -1
- package/dist/docs-site/img/icons/knowledge-base.svg +0 -1
- package/dist/docs-site/img/icons/mail.svg +0 -1
- package/dist/docs-site/img/icons/mobile.svg +0 -1
- package/dist/docs-site/img/icons/model.svg +0 -1
- package/dist/docs-site/img/icons/network.svg +0 -1
- package/dist/docs-site/img/icons/orchestrator.svg +0 -1
- package/dist/docs-site/img/icons/plug.svg +0 -1
- package/dist/docs-site/img/icons/pr-reviewer.svg +0 -1
- package/dist/docs-site/img/icons/replay.svg +0 -1
- package/dist/docs-site/img/icons/report.svg +0 -1
- package/dist/docs-site/img/icons/result.svg +0 -1
- package/dist/docs-site/img/icons/rule.svg +0 -1
- package/dist/docs-site/img/icons/scribe.svg +0 -1
- package/dist/docs-site/img/icons/shield.svg +0 -1
- package/dist/docs-site/img/icons/specs.svg +0 -1
- package/dist/docs-site/img/icons/speed.svg +0 -1
- package/dist/docs-site/img/icons/stories.svg +0 -1
- package/dist/docs-site/img/icons/terminal.svg +0 -1
- package/dist/docs-site/img/icons/test-finder.svg +0 -1
- package/dist/docs-site/img/icons/visual.svg +0 -1
- package/dist/docs-site/img/icons/web.svg +0 -1
- package/dist/docs-site/img/icons/wikis.svg +0 -1
- package/dist/web/assets/Agent-MlW7cfAm.js +0 -7
- package/dist/web/assets/ApiTests-mxUkUZvv.js +0 -10
- package/dist/web/assets/Browse-DENLuv4C.js +0 -2
- package/dist/web/assets/Chat-jxak1jci.js +0 -3
- package/dist/web/assets/Cost-CEOZgbPs.js +0 -1
- package/dist/web/assets/Desktop-DGNdy7iS.js +0 -1
- package/dist/web/assets/DesktopReview-SdAwvi9y.js +0 -1
- package/dist/web/assets/Evidence-DTrdEz3M.js +0 -1
- package/dist/web/assets/Flags-CkKp4bbv.js +0 -2
- package/dist/web/assets/KindPage-DPADNnwH.js +0 -6
- package/dist/web/assets/PageAgent-CB8HtdGd.js +0 -1
- package/dist/web/assets/Production-Nst6__N7.js +0 -1
- package/dist/web/assets/Quality-DgNo4H0u.js +0 -1
- package/dist/web/assets/Readiness--GiTxFZo.js +0 -1
- package/dist/web/assets/Record-a4whC1jV.js +0 -1
- package/dist/web/assets/Regression-hesOlN4G.js +0 -5
- package/dist/web/assets/RelationGraph-C3Re0M1N.js +0 -1
- package/dist/web/assets/Response-CzX2rQEZ.js +0 -9
- package/dist/web/assets/RunDiff-CIdQD95y.js +0 -1
- package/dist/web/assets/TestCases-D-ZRb2N7.js +0 -1
- package/dist/web/assets/TestDebt-BvP3w7ye.js +0 -1
- package/dist/web/assets/TestManagement-CphGo9DZ.js +0 -1
- package/dist/web/assets/agentTabs-BO5l3zw2.js +0 -1
- package/dist/web/assets/dataParts-DeUdfjjv.js +0 -3
- package/dist/web/assets/diff-D1_Qo2h1.js +0 -2
- package/dist/web/assets/frame-VTMu7MoC.js +0 -13
- package/dist/web/assets/index-CKRa-K2y.css +0 -2
- package/dist/web/assets/index-nuLrB-Rb.js +0 -69
- package/dist/web/assets/logos-J6txZkKc.js +0 -1
- package/dist/web/assets/paletteCommands-BmYmp6YY.js +0 -1
- package/dist/web/assets/parts-CDBCk_Xz.js +0 -1
- package/dist/web/assets/qualityParts-CGKSK9Dq.js +0 -1
- package/dist/web/assets/rows-yPc39hV7.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as e,Ir as t,M as n,P as r,R as i,dn as a,pt as o,yr as s,zr as c}from"./line-icons-C_amZ5-o.js";import{$t as l,B as u,Rt as d,V as f,f as p,l as m,o as h,p as g,st as _,t as v,z as y}from"./filters-CVzIOjPG.js";import{Bt as b,at as x,bn as S,bt as C,o as w,t as T}from"./frame-VTMu7MoC.js";import{_ as E,r as D}from"./index-nuLrB-Rb.js";import{r as O}from"./families-DWilSDct.js";import{_ as k,o as A}from"./qualityParts-CGKSK9Dq.js";var j=c(t(),1),M=l(),N={server:{label:`The server answered differently`,hint:`A call returned another status: likely a product or backend change, not the test. File it as a defect if the first run was right.`},locator:{label:`An element was not found`,hint:`The page likely changed under the test. If the change was intended, heal the test; if not, it is a product bug.`},navigation:{label:`It reached another page`,hint:`A redirect, a sign-in, a feature flag or the environment's settings may differ between the runs.`},path:{label:`It took another path`,hint:`The run did something else here: the flow changed, or the agent found another way through it.`},data:{label:`Same step, another outcome`,hint:`The step was the same but ended otherwise: the test data, the account or what the page held likely differs.`},timing:{label:`Only the timing differs`,hint:`A slow environment, or a wait that races the page: a likely cause of flaky failures.`},errors:{label:`New browser errors`,hint:`The page raised errors in the second run that it did not in the first.`},missing:{label:`A step only one run did`,hint:`One run has a step the other does not: a dialog, a retry or a changed flow.`}},P=e=>`${(e/1e3).toFixed(1)}s`,F=e=>`${e.goal.slice(0,80)} · ${e.status} · ${D(e.at)}`;function I(e,t){let n=e.find(e=>e.id===t),r=e.filter(e=>e.id!==t);if(!n)return{same:[],other:r};let i=n.goal.trim().toLowerCase();return{same:r.filter(e=>e.goal.trim().toLowerCase()===i),other:r.filter(e=>e.goal.trim().toLowerCase()!==i)}}function L({run:e,step:t}){let[n,r]=(0,j.useState)(``),[i,a]=(0,j.useState)(!1);return(0,j.useEffect)(()=>{let n=!1;return r(``),a(!1),t?.shot&&d.shot(e,t.n,t.shot).then(e=>!n&&r(e),()=>!n&&a(!0)),()=>{n=!0}},[e,t?.n,t?.shot]),t?!t.shot||i?(0,M.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-6 text-center text-[13px] text-muted`,children:`No screenshot`}):n?(0,M.jsx)(`img`,{src:n,alt:`Step ${t.n} of ${e}`,className:`max-h-[420px] w-full rounded-[12px] border border-line-soft object-contain object-top`}):(0,M.jsx)(`div`,{className:`min-h-24 rounded-[12px] bg-surface-muted`}):(0,M.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-6 text-center text-[13px] text-muted`,children:`Not in this run`})}function R({step:e,other:t}){if(!e)return(0,M.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Not in this run`});let r=e.ok?n:i,a=new Set((t?.calls??[]).map(e=>`${e.method} ${e.path} ${e.status}`)),o=t?e.calls.filter(e=>!a.has(`${e.method} ${e.path} ${e.status}`)):[];return(0,M.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,M.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2`,children:[(0,M.jsx)(r,{size:14,"aria-label":e.ok?`Passed`:`Failed`,className:f(`mt-1 flex-none`,e.ok?`text-pass`:`text-fail`)}),(0,M.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:e.action||`–`})]}),(0,M.jsxs)(`span`,{className:`truncate text-[13px] text-muted`,"data-tip":e.title?`${e.title} · ${e.page}`:e.page,children:[e.page,typeof e.ms==`number`?` · ${P(e.ms)}`:``]}),e.error&&(0,M.jsx)(`span`,{className:`text-[13px] text-fail [overflow-wrap:anywhere]`,children:e.error}),o.slice(0,3).map(e=>(0,M.jsxs)(`span`,{className:f(`truncate font-mono text-[13px]`,e.status>=400||e.failed?`text-fail`:`text-muted`),"data-tip":`${e.method} ${e.path}`,children:[e.method,` `,e.path,` `,e.failed?`no answer`:e.status]},`${e.method} ${e.path}`)),e.problems.slice(0,2).map(e=>(0,M.jsx)(`span`,{className:`truncate text-[13px] text-warn`,"data-tip":e,children:e},e))]})}function z({row:t,i:n,a:r,b:i,focus:a,open:o,onToggle:s}){let c=t.a?.n,l=t.b?.n;return(0,M.jsxs)(`li`,{id:a?`look-here`:void 0,className:f(`border-t border-line-soft`,!t.same&&`bg-warn-soft/40`,a&&`outline-2 -outline-offset-2 outline-warn`),children:[(0,M.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] items-start gap-4 px-4 py-2 text-[13px]`,children:[(0,M.jsx)(`span`,{className:`pt-1 text-muted tabular-nums`,"data-tip":c!==void 0&&l!==void 0&&c!==l?`Step ${c} of the first run, ${l} of the second`:void 0,children:c!==void 0&&l!==void 0&&c!==l?`${c}·${l}`:c??l??n+1}),(0,M.jsx)(R,{step:t.a,other:t.b}),(0,M.jsx)(R,{step:t.b,other:t.a}),(0,M.jsx)(y,{variant:`icon`,size:`icon-sm`,"aria-label":o?`Hide screenshots`:`Show screenshots`,"aria-expanded":o,onClick:s,"data-tip":o?`Hide screenshots`:`Show screenshots`,children:(0,M.jsx)(e,{"aria-hidden":`true`,className:f(`transition-transform`,o&&`rotate-180`)})})]}),!t.same&&(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pb-2 pl-[3.75rem] text-[13px] text-ink-2`,children:[a&&t.kind&&(0,M.jsxs)(`span`,{className:`font-medium text-warn`,children:[`Look here first: `,N[t.kind].label]}),t.differences.map(e=>(0,M.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e},e))]}),(0,M.jsx)(b,{open:o,children:(0,M.jsxs)(`div`,{className:`grid grid-cols-1 items-start gap-4 px-4 pb-4 @2xl:grid-cols-2`,children:[(0,M.jsx)(L,{run:r,step:t.a}),(0,M.jsx)(L,{run:i,step:t.b})]})})]})}function B({runs:e,a:t,b:n}){let[r,i]=(0,j.useState)(t??``),[a,s]=(0,j.useState)(n??``);(0,j.useEffect)(()=>{i(t??``),s(n??``)},[t,n]);let{same:c,other:l}=I(e,r);return(0,M.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),r&&a&&r!==a&&(location.hash=g(`run-diff`,`${encodeURIComponent(r)}~${encodeURIComponent(a)}`))},children:[(0,M.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-[13px] font-medium`,children:[`First run (as expected)`,(0,M.jsxs)(h,{size:`sm`,value:r,onChange:e=>i(e.target.value),children:[(0,M.jsx)(`option`,{value:``,children:`Pick a run`}),e.map(e=>(0,M.jsx)(`option`,{value:e.id,children:F(e)},e.id))]})]}),(0,M.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-[13px] font-medium`,children:[`Second run`,(0,M.jsxs)(h,{size:`sm`,value:a,onChange:e=>s(e.target.value),disabled:!r,children:[(0,M.jsx)(`option`,{value:``,children:r?`Pick a run to compare`:`Pick the first run`}),c.length>0&&(0,M.jsx)(`optgroup`,{label:`Same test`,children:c.map(e=>(0,M.jsx)(`option`,{value:e.id,children:F(e)},e.id))}),(0,M.jsx)(`optgroup`,{label:c.length?`Other runs`:`Runs`,children:l.map(e=>(0,M.jsx)(`option`,{value:e.id,children:F(e)},e.id))})]})]}),(0,M.jsxs)(y,{size:`sm`,variant:`primary`,type:`submit`,disabled:!r||!a||r===a,children:[(0,M.jsx)(o,{"aria-hidden":`true`}),`Compare`]})]})}function V({sub:e}){let[t,n]=(0,j.useState)(null),[i,o]=(0,j.useState)(null),[c,l]=(0,j.useState)(``),[h,b]=(0,j.useState)(`all`),[D,F]=(0,j.useState)(new Set),[I,L]=(0,j.useState)(``),[R,V]=(0,j.useMemo)(()=>{let t=(e?p(e):``).split(`~`);return t.length===2&&t[0]&&t[1]?[t[0],t[1]]:[void 0,void 0]},[e]);(0,j.useEffect)(()=>{d.runs().then(e=>n(e.runs),e=>l(e.message))},[]),(0,j.useEffect)(()=>{let e=!1;if(o(null),L(``),R&&V)return d.diff(R,V).then(t=>{e||(o(t),l(``),F(new Set(t.focus===void 0?[]:[t.focus])))},t=>!e&&l(t.message)),()=>{e=!0}},[R,V]);let H=async()=>{if(i)try{let{id:e}=await _.start(`Compare the browser runs ${i.a.id} and ${i.b.id} in the reports folder, step by step (their steps.json, network.json and screenshots). Say where they first differ and whether that is a product bug, a test that needs healing, test data or the environment, and what to do next.`,{});location.hash=g(`chats`,e)}catch(e){L(e.message)}},U=i?.rows??[],W=U.map((e,t)=>({r:e,i:t})).filter(({r:e})=>h===`all`||!e.same),G=e=>e===void 0?void 0:U[e]?.b?.n??U[e]?.a?.n,K=G(i?.first),q=G(i?.focus);return(0,M.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,M.jsx)(w,{}),(0,M.jsxs)(`main`,{className:f(T,`@container flex-auto gap-4`),children:[(0,M.jsx)(E,{}),(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,M.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,M.jsx)(C,{pixel:S[`run-diff`],size:`lg`}),(0,M.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Run diff`})]}),(0,M.jsx)(x,{label:`Runs and reports`,links:O,current:`run-diff`})]}),(0,M.jsx)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:`Two browser runs side by side, step by step: a run that passed and one that failed, the same test on two environments or devices, or a test before and after it was healed. Steps are lined up by page and action, and the first one that differs is marked with what it likely means.`}),c&&(0,M.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:c}),!t&&!c&&(0,M.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),t&&t.length<2&&(0,M.jsx)(m,{icon:s,title:`Two runs are needed`,action:(0,M.jsxs)(`a`,{className:u({size:`sm`}),href:g(`record`),"data-tip":`Record a flow`,children:[(0,M.jsx)(r,{"aria-hidden":`true`}),`Record`]}),children:`Every browser run keeps its steps in the reports folder. Run a flow from a chat or the Record page twice, or a test case on two environments, and compare them here.`}),t&&t.length>=2&&(0,M.jsx)(B,{runs:t,a:R,b:V}),R&&V&&!i&&!c&&(0,M.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Comparing…`}),i&&(0,M.jsxs)(`section`,{"aria-label":`Comparison`,className:`flex min-w-0 flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-3 @4xl:grid-cols-6 @4xl:divide-x @4xl:divide-line-soft`,children:[(0,M.jsx)(A,{label:`Verdict`,value:i.first===void 0?`Same`:`Differ`,tone:i.first===void 0?`text-pass`:`text-warn`,sub:i.first===void 0?`every step alike`:`from step ${K??`?`}`}),(0,M.jsx)(A,{label:`Steps differing`,value:i.counts.differing,tone:i.counts.differing?`text-warn`:void 0,sub:`of ${U.length} lined up`}),(0,M.jsx)(A,{label:`Steps`,value:`${i.a.steps} · ${i.b.steps}`,sub:`first · second`}),(0,M.jsx)(A,{label:`Time`,value:`${P(i.a.ms)} · ${P(i.b.ms)}`,sub:`first · second`}),(0,M.jsx)(A,{label:`Calls answered otherwise`,value:i.counts.calls,tone:i.counts.calls?`text-fail`:void 0,sub:`steps with a different status`}),(0,M.jsx)(A,{label:`New browser errors`,value:i.counts.errors,tone:i.counts.errors?`text-fail`:void 0,sub:`steps with new errors`})]}),(0,M.jsx)(`div`,{className:`grid grid-cols-1 gap-2 text-[13px] @2xl:grid-cols-2`,children:[i.a,i.b].map((e,t)=>(0,M.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,M.jsx)(`span`,{className:`text-[13px] text-muted`,children:t?`Second run`:`First run`}),(0,M.jsx)(`span`,{className:`truncate font-medium`,"data-tip":e.goal,children:e.goal}),(0,M.jsxs)(`span`,{className:`truncate text-[13px] text-muted`,"data-tip":e.startUrl??e.id,children:[e.status,` · `,k(e.at),` · `,e.host??e.id]})]},e.id))}),!i.sameGoal&&(0,M.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:`These runs had different goals: they may not be the same test.`}),i.kind&&(0,M.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4 rounded-[12px] bg-warn-soft px-4 py-2 text-[13px]`,children:[(0,M.jsx)(s,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none text-warn`}),(0,M.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,M.jsxs)(`span`,{className:`font-medium`,children:[`Look at step `,q??`?`,` of the second run: `,N[i.kind].label]}),(0,M.jsx)(`span`,{className:`text-ink-2`,children:N[i.kind].hint}),i.first!==i.focus&&i.first!==void 0&&U[i.first]?.kind&&(0,M.jsxs)(`span`,{className:`text-ink-2`,children:[`They first differ at step `,K,`: `,N[U[i.first].kind].label.toLowerCase(),`.`]})]}),(0,M.jsx)(`a`,{href:`#look-here`,onClick:e=>(e.preventDefault(),document.getElementById(`look-here`)?.scrollIntoView({behavior:`smooth`,block:`center`})),className:`self-center text-[13px]`,children:`Go to it`})]}),(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,M.jsx)(v,{items:[{id:`all`,label:`All steps`,n:U.length},{id:`diff`,label:`Only differences`,n:i.counts.differing,alert:!0}],value:h,onChange:b})}),(0,M.jsxs)(y,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void H(),className:`ml-auto`,children:[(0,M.jsx)(a,{"aria-hidden":`true`}),`Chat`]})]}),I&&(0,M.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:I}),(0,M.jsxs)(`div`,{className:`overflow-hidden rounded-[10px] border border-line`,children:[(0,M.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] gap-4 bg-surface-muted px-4 py-2 text-[13px] text-muted`,children:[(0,M.jsx)(`span`,{children:`Step`}),(0,M.jsx)(`span`,{children:`First run`}),(0,M.jsx)(`span`,{children:`Second run`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Screenshots`})]}),W.length?(0,M.jsx)(`ol`,{className:`m-0 list-none p-0`,children:W.map(({r:e,i:t})=>(0,M.jsx)(z,{row:e,i:t,a:i.a.id,b:i.b.id,focus:t===i.focus,open:D.has(t),onToggle:()=>{let e=new Set(D);e.has(t)?e.delete(t):e.add(t),F(e)}},t))}):(0,M.jsx)(`p`,{className:`m-0 border-t border-line-soft px-4 py-4 text-[13px] text-muted`,children:`Nothing differs.`})]})]})]})]})}export{N as KIND_TEXT,V as RunDiff,I as choicesFor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ir as e,Lt as t,Nr as n,at as r,nn as i,o as a,ot as o,tn as s,w as c,yr as l,z as u,zr as d}from"./line-icons-C_amZ5-o.js";import{$t as f,Kt as p,V as m,a as h,et as g,f as _,g as v,l as y,p as b,t as x,z as S}from"./filters-CVzIOjPG.js";import{$ as C,X as w,Z as T,bn as E,bt as D,o as O,t as k,tt as A}from"./frame-VTMu7MoC.js";import{s as j}from"./markdown-CWisJbSJ.js";import{_ as M,r as N,s as P}from"./index-nuLrB-Rb.js";var F=d(e(),1),I=f(),L=[{id:`azure_devops`,label:`Azure DevOps`},{id:`jira`,label:`Jira`},{id:`testrail`,label:`TestRail`},{id:`zephyr`,label:`Zephyr Scale`},{id:`qtest`,label:`qTest`}],R=e=>L.some(t=>t.id===e),z=e=>e&&j(e)===`web`?e:void 0,B=(e,t)=>`${e} ${t}${e===1?``:`s`}`,V=e=>`${e.kind}:${e.id}`;function H(e){return e.found===`reuse`||e.kind===`link`?`Link`:e.found===`extends`||e.kind===`extend`?`Add ${B((e.insert??[]).reduce((e,t)=>e+t.steps.length,0),`step`)}`:`Update steps`}function U(e,t){let n=`Story ${t} asks for it: ${e.wrote}`,r=e.link?{link:!0}:{};return e.kind===`link`?{kind:`link`,id:e.id}:e.kind===`extend`?{kind:`extend`,id:e.id,insert:e.insert??[],reason:n,...r}:{kind:`update`,id:e.id,steps:e.steps??[],reason:n,...r}}function W(){let[e,t]=(0,F.useState)(L.map(e=>e.id)),[n,r]=(0,F.useState)(``);return(0,F.useEffect)(()=>{g.settings().then(e=>{let n=e.config.sources??{},r=L.map(e=>e.id).filter(e=>n[e]&&typeof n[e]==`object`);r.length&&t(r)},e=>r(`The settings could not be read, so every system is offered: ${e.message}`))},[]),{systems:L.filter(t=>e.includes(t.id)),error:n}}function G({id:e,icon:t,title:n,children:r}){return(0,I.jsxs)(`section`,{"aria-labelledby":e,className:`flex min-w-0 flex-col gap-4`,children:[(0,I.jsxs)(`h2`,{id:e,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,I.jsx)(v,{icon:t,size:18,className:`text-accent-fg`}),n]}),r]})}function K({view:e,onApplied:a,onError:d}){let[f,h]=(0,F.useState)([]),[g,_]=(0,F.useState)(null),[v,y]=(0,F.useState)(!1),[b,x]=(0,F.useState)(null),E=e.story.id,D=e.proposals.filter(e=>f.includes(V(e))),O=async()=>{let t=D.map(e=>U(e,E));y(!0);try{let n=await p.preview(e.system,E,t);_({lines:n.lines,changes:t}),d(``)}catch(e){d(e.message)}finally{y(!1)}},k=async()=>{if(g){y(!0);try{let t=await p.apply(e.system,E,g.changes);x({applied:t.applied,failed:t.failed}),_(null),h([]),d(``),a()}catch(e){d(e.message)}finally{y(!1)}}},j=z(e.story.url);return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,I.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-lg font-semibold [overflow-wrap:anywhere]`,children:[j?(0,I.jsxs)(`a`,{href:j,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[E,(0,I.jsx)(r,{size:14,"aria-hidden":`true`})]}):(0,I.jsx)(`span`,{children:E}),e.story.title&&(0,I.jsx)(`span`,{className:`font-normal text-ink-2`,children:e.story.title})]}),e.changed&&(0,I.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,"data-tip":new Date(e.changed.when).toLocaleString(),children:[`The story's `,e.changed.field,` changed `,N(e.changed.when),`.`]})]}),(0,I.jsx)(G,{id:`cases-h`,icon:s,title:`Linked cases`,children:(0,I.jsx)(w,{label:`Linked cases`,empty:`No test case is linked to this story.`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`th`,{className:C,children:`Case`}),(0,I.jsx)(`th`,{className:C,children:`Title`}),(0,I.jsx)(`th`,{className:m(C,`text-right`),children:`Steps`}),(0,I.jsx)(`th`,{className:C,children:`State`})]}),children:e.cases.map(e=>{let t=z(e.url);return(0,I.jsxs)(`tr`,{className:A,children:[(0,I.jsx)(`td`,{className:m(T,`whitespace-nowrap`),children:t?(0,I.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[e.id,(0,I.jsx)(r,{size:12,"aria-hidden":`true`})]}):e.id}),(0,I.jsx)(`td`,{className:m(T,`[overflow-wrap:anywhere]`),children:e.title}),(0,I.jsx)(`td`,{className:m(T,`text-right tabular-nums`),children:e.steps}),(0,I.jsx)(`td`,{className:m(T,e.stale?`text-warn`:`text-muted`),children:e.stale?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(l,{size:13,"aria-hidden":`true`,className:`flex-none`}),`older than the story's last change`]}):e.changed?(0,I.jsxs)(`span`,{"data-tip":new Date(e.changed).toLocaleString(),children:[`changed `,N(e.changed)]}):`–`})]},e.id)})})}),(0,I.jsx)(G,{id:`criteria-h`,icon:u,title:`Acceptance criteria`,children:(0,I.jsx)(w,{label:`Acceptance criteria`,empty:`No acceptance criteria were read for this story.`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`th`,{className:C,children:`Criterion`}),(0,I.jsx)(`th`,{className:C,children:`Cases`})]}),children:e.criteria.map((e,t)=>(0,I.jsxs)(`tr`,{className:A,children:[(0,I.jsx)(`td`,{className:m(T,`[overflow-wrap:anywhere]`),children:e.text}),(0,I.jsx)(`td`,{className:m(T,e.cases.length?`text-ink-2`:`text-warn`),children:e.cases.length?e.cases.join(`, `):`no case`})]},t))})}),(0,I.jsxs)(G,{id:`proposals-h`,icon:i,title:`Proposed changes`,children:[(0,I.jsx)(w,{label:`Proposed changes`,empty:`No change is waiting. save_test_cases in a chat proposes them.`,tools:(0,I.jsxs)(S,{size:`sm`,variant:`primary`,disabled:v||!D.length||!!g,"data-tip":`Review ${B(D.length,`change`)}`,onClick:()=>void O(),children:[(0,I.jsx)(o,{"aria-hidden":`true`}),`Review (`,D.length,`)`]}),head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`th`,{className:m(C,`w-10`),children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,I.jsx)(`th`,{className:C,children:`Change`}),(0,I.jsx)(`th`,{className:C,children:`Existing case`}),(0,I.jsx)(`th`,{className:C,children:`The agent wrote`})]}),children:e.proposals.map(e=>{let t=V(e);return(0,I.jsxs)(`tr`,{className:A,children:[(0,I.jsx)(`td`,{className:T,children:(0,I.jsx)(P,{"aria-label":`${H(e)}: ${e.id} ${e.title}`,checked:f.includes(t),disabled:v||!!g,onCheckedChange:e=>h(e?[...f,t]:f.filter(e=>e!==t))})}),(0,I.jsxs)(`td`,{className:m(T,`whitespace-nowrap font-medium`),children:[H(e),e.link&&e.kind!==`link`&&(0,I.jsx)(`span`,{className:`block text-[13px] font-normal text-muted`,children:`and link it`})]}),(0,I.jsxs)(`td`,{className:m(T,`[overflow-wrap:anywhere]`),children:[(0,I.jsx)(`span`,{className:`font-mono text-[13px] text-ink-2`,children:e.id}),` `,e.title]}),(0,I.jsx)(`td`,{className:m(T,`text-ink-2 [overflow-wrap:anywhere]`),children:e.wrote})]},t)})}),g&&(0,I.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Apply the changes`,className:`flex flex-col gap-2 rounded-[10px] border border-accent-line bg-accent-soft p-4 text-[13px]`,children:[(0,I.jsxs)(`span`,{className:`font-medium`,children:[`Apply `,B(g.changes.length,`change`),` to `,L.find(t=>t.id===e.system)?.label,`?`]}),(0,I.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-6 text-ink-2`,children:g.lines.map((e,t)=>(0,I.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsxs)(S,{size:`sm`,variant:`primary`,disabled:v,onClick:()=>void k(),children:[(0,I.jsx)(c,{"aria-hidden":`true`}),`Apply`]}),(0,I.jsxs)(S,{size:`sm`,disabled:v,onClick:()=>_(null),children:[(0,I.jsx)(n,{"aria-hidden":`true`}),`Cancel`]})]})]}),b&&b.applied.length>0&&(0,I.jsxs)(`p`,{role:`status`,className:`m-0 text-[13px] text-pass`,children:[`Applied: `,b.applied.join(`, `)]}),b&&b.failed.length>0&&(0,I.jsxs)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Not applied: `,b.failed.map(e=>`${e.id||`a change`}: ${e.error}`).join(`; `)]})]}),(0,I.jsx)(G,{id:`changes-h`,icon:t,title:`Recent changes`,children:e.changes.length?(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] text-ink-2`,children:e.changes.map((e,t)=>(0,I.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}):(0,I.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`ForgeQE has not changed this story's cases.`})}),e.notes.map((e,t)=>(0,I.jsx)(`p`,{className:`m-0 text-[13px] text-muted [overflow-wrap:anywhere]`,children:e},t))]})}function q({sub:e}){let{systems:t,error:n}=W(),r=e?e.indexOf(`/`):-1,i=r>0?e.slice(0,r):e,o=R(i)?i:void 0,c=o&&r>0?_(e.slice(r+1)):``,[l,u]=(0,F.useState)(o??`azure_devops`),[d,f]=(0,F.useState)(c),[g,v]=(0,F.useState)(null),[C,w]=(0,F.useState)(``),[T,A]=(0,F.useState)(!1);(0,F.useEffect)(()=>{o&&u(o),f(c)},[o,c]),(0,F.useEffect)(()=>{!o&&t.length&&!t.some(e=>e.id===l)&&u(t[0].id)},[t,l,o]);let j=(0,F.useCallback)(()=>{!o||!c?v(null):(A(!0),p.view(o,c).then(e=>{v(e),w(``),A(!1)},e=>{w(e.message),A(!1)}))},[o,c]);return(0,F.useEffect)(()=>v(null),[o,c]),(0,F.useEffect)(j,[j]),(0,I.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,I.jsx)(O,{}),(0,I.jsxs)(`main`,{className:m(k,`@container flex-auto gap-4`),children:[(0,I.jsx)(M,{}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,I.jsx)(D,{pixel:E[`test-cases`],size:`lg`}),(0,I.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test cases`})]}),(0,I.jsxs)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:[`A story's test cases in your test management system: which are older than the story's last change, which acceptance criteria no case covers, and the changes save_test_cases proposed. Tick the ones to make; nothing is written until you review and apply them. The tests that run them are on `,(0,I.jsx)(`a`,{href:b(`regression`),children:`Regression`}),`; their results on `,(0,I.jsx)(`a`,{href:b(`runs`),children:`Runs`}),`.`]}),(0,I.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=d.trim();if(!t)return;let n=b(`test-cases`,l,encodeURIComponent(t));location.hash===n?j():location.hash=n},className:`flex flex-col gap-4`,children:[(0,I.jsx)(`div`,{role:`group`,"aria-label":`System`,className:`flex flex-wrap gap-2`,children:(0,I.jsx)(x,{items:t,value:l,onChange:u})}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4`,children:[(0,I.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_320px] flex-col gap-1 text-[13px] font-medium`,children:[`Story`,(0,I.jsx)(h,{value:d,maxLength:120,spellCheck:!1,placeholder:l===`azure_devops`?`1234`:l===`qtest`?`5678`:l===`testrail`?`R12`:`SHOP-12`,onChange:e=>f(e.target.value)})]}),(0,I.jsxs)(S,{type:`submit`,variant:`primary`,disabled:!d.trim()||T,"data-tip":`Open the story's test cases`,children:[(0,I.jsx)(a,{"aria-hidden":`true`}),`Open`]})]})]}),[n,C].filter(Boolean).map(e=>(0,I.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:e},e)),T&&(0,I.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),g&&(0,I.jsx)(K,{view:g,onApplied:j,onError:w},`${g.system}:${g.story.id}`),!c&&!g&&(0,I.jsx)(y,{icon:s,title:`No story opened yet`,children:`Pick the system and type a story's id to see its linked test cases, its acceptance criteria and which cases trace to them. When save_test_cases runs in a chat for a story, the changes it proposes to existing cases show here to apply.`})]})]})}export{q as TestCases};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fn as e,Ir as t,M as n,N as r,R as i,Y as a,ar as o,o as s,tn as ee,xr as c,yr as l,zr as u}from"./line-icons-C_amZ5-o.js";import{$t as d,B as f,V as p,a as te,l as m,o as ne,ot as h,p as g,st as _,t as v,z as y}from"./filters-CVzIOjPG.js";import{X as b,bn as x,bt as S,o as C,t as re}from"./frame-VTMu7MoC.js";import{_ as ie,r as w}from"./index-nuLrB-Rb.js";import{_ as T,o as E}from"./qualityParts-CGKSK9Dq.js";var D=u(t(),1),O={view:()=>h(`GET`,`/api/testdebt`),refresh:()=>h(`POST`,`/api/testdebt/refresh`,{}),readCases:(e,t)=>h(`POST`,`/api/testdebt/cases`,{source:e,scope:t})},k=d(),A=[`untested`,`signal`,`duplicates`,`cases`],j={endpoint:`Endpoint`,screen:`Screen`,file:`Code file`},M={test:`Test`,recording:`Recording`,case:`Test case`},N={azure_devops:`Azure DevOps`,jira:`Jira`,xray:`Xray`,testrail:`TestRail`,zephyr:`Zephyr Scale`,qtest:`qTest`,other:`Other`},P={azure_devops:`plan=12/suite=34`,testrail:`run=7`,zephyr:`cycle=SHOP-R12`,qtest:`cycle=12`,xray:`plan=SHOP-100`},F=e=>`${Math.round(e*100)}%`,I=e=>A.includes(e)?e:`untested`;function L({part:e,what:t,action:n}){return(0,k.jsxs)(m,{icon:l,title:e.state===`empty`?`No ${t} yet`:`${t[0].toUpperCase()}${t.slice(1)}: not connected`,action:(0,k.jsxs)(`a`,{className:f({size:`sm`}),href:n.to,"data-tip":`Open ${n.label}`,children:[(0,k.jsx)(s,{"aria-hidden":`true`}),n.label]}),children:[`To see this list, set `,e.set,`.`]})}function R({text:e,tip:t}){return(0,k.jsx)(`span`,{"data-tip":t??e,className:`block truncate`,children:e})}function z({sub:t}){let[l,u]=(0,D.useState)(null),[d,h]=(0,D.useState)(``),[A,z]=(0,D.useState)(!1),[B,V]=(0,D.useState)(``),H=I(t),[U,W]=(0,D.useState)(`all`),[G,ae]=(0,D.useState)(`manual`),[oe,se]=(0,D.useState)(``),[K,ce]=(0,D.useState)(``);(0,D.useEffect)(()=>{O.view().then(e=>{u(e),h(``)},e=>h(e.message))},[]);let q=(0,D.useCallback)(async(e,t)=>{z(!0),V(``);try{u(await e()),h(``),t&&V(t)}catch(e){h(e.message)}finally{z(!1)}},[]),le=async e=>{if(e){z(!0);try{let{id:t}=await _.start(e,{});location.hash=g(`chats`,t)}catch(e){h(e.message),z(!1)}}},J=(e,t)=>(0,k.jsx)(y,{size:`icon`,variant:`icon`,className:`size-8`,disabled:A||!e,onClick:()=>void le(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,k.jsx)(o,{"aria-hidden":`true`})}),Y=l?.sources.filter(e=>e.connected&&e.id!==`jira`)??[],X=oe||Y[0]?.id||``,Z=l?.cases.filter(e=>!e.automated).length??0,ue=l?.areas.filter(e=>U===`all`||e.kind===U)??[],de=l?.cases.filter(e=>G===`all`||(G===`manual`?!e.automated:e.automated))??[],Q=`py-2 pr-4 text-right tabular-nums`,$={untested:(l?.areas.length??0)+(l?.rules.length??0),signal:(l?.quiet.length??0)+(l?.gone.length??0),duplicates:l?.duplicates.length??0,cases:Z};return(0,k.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,k.jsx)(C,{}),(0,k.jsxs)(`main`,{className:p(re,`@container flex-auto gap-4`),children:[(0,k.jsx)(ie,{}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,k.jsx)(S,{pixel:x[`test-debt`],size:`lg`}),(0,k.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test debt`}),l&&(0,k.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[13px] text-muted`,children:[(0,k.jsxs)(`span`,{"data-tip":T(l.at),children:[`Worked out `,w(l.at)]}),(0,k.jsxs)(y,{size:`sm`,disabled:A,onClick:()=>void q(O.refresh,`Worked out again.`),children:[(0,k.jsx)(e,{"aria-hidden":`true`}),`Refresh`]})]})]}),(0,k.jsxs)(`p`,{className:`m-0 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,k.jsx)(`a`,{href:g(`product`),children:`product graph`}),`, tests that passed every one of their last 30 runs or whose file is gone from `,l?.repo&&l.repo!==`.`?(0,k.jsx)(`code`,{className:`font-mono text-[13px]`,children:l.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.`]}),d&&(0,k.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:d}),!l&&!d&&(0,k.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),B&&(0,k.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2`,children:B}),l&&(0,k.jsxs)(k.Fragment,{children:[(0,k.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,k.jsx)(E,{label:`Untested code`,value:l.graph.state===`ok`?l.areas.length:`–`,tone:l.areas.length?`text-warn`:void 0,sub:l.graph.state===`ok`?`of ${l.graph.checked} areas`:`graph not built`}),(0,k.jsx)(E,{label:`Untested rules`,value:l.rules.length,tone:l.rules.length?`text-warn`:void 0,sub:`of ${l.graph.rulesChecked} rules`}),(0,k.jsx)(E,{label:`Never fail`,value:l.quiet.length,sub:`30 passes in a row`}),(0,k.jsx)(E,{label:`Code gone`,value:l.gone.length,tone:l.gone.length?`text-fail`:void 0,sub:`of ${l.files.count} files listed`}),(0,k.jsx)(E,{label:`Near-duplicates`,value:l.duplicates.length,sub:`from ${F(l.threshold)} alike`}),(0,k.jsx)(E,{label:`Not automated`,value:Z,tone:Z?`text-warn`:void 0,sub:`of ${l.cases.length} test cases`})]}),(0,k.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,k.jsx)(v,{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:H,onChange:e=>location.hash=g(`test-debt`,e)})}),l.notes.map(e=>(0,k.jsx)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:e},e)),H===`untested`&&(0,k.jsxs)(k.Fragment,{children:[l.graph.state===`ok`?(0,k.jsx)(b,{label:`Code no test reaches`,placeholder:`Find an endpoint, screen or file`,resetKey:U,empty:l.areas.length?`Nothing matches.`:`Every endpoint, screen and code file the graph holds is reached by a test.`,tools:(0,k.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,k.jsx)(v,{items:[{id:`all`,label:`All`,n:l.areas.length},...[`endpoint`,`screen`,`file`].map(e=>({id:e,label:`${j[e]}s`,n:l.areas.filter(t=>t.kind===e).length}))],value:U,onChange:W})}),head:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[34%]`),children:`Code`}),(0,k.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Kind`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Where`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Used by`}),(0,k.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:ue.map(e=>(0,k.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`max-w-0`),children:(0,k.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(r,{size:15,"aria-label":`No test reaches it`,className:`flex-none text-warn`}),(0,k.jsx)(R,{text:e.name,tip:`${e.name} · ${e.known===`observed`?`read in the code`:`worked out from the code`}`})]})}),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`text-[13px] whitespace-nowrap`),children:j[e.kind]}),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`hidden max-w-0 font-mono text-[13px] text-ink-2 @xl:table-cell`),children:(0,k.jsx)(R,{text:e.where})}),(0,k.jsx)(`td`,{className:p(Q,`hidden text-muted @2xl:table-cell`),children:e.users}),(0,k.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,j[e.kind].toLowerCase())})]},e.id))}):(0,k.jsx)(L,{part:l.graph,what:`product graph`,action:{label:`Product`,to:g(`product`)}}),(0,k.jsx)(b,{label:`Business rules no test checks`,placeholder:`Find a rule`,empty:l.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,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[46%]`),children:`Rule`}),(0,k.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`From`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Where`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Closest test`}),(0,k.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:l.rules.map(e=>(0,k.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`max-w-0`),children:(0,k.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(r,{size:15,"aria-label":`No test checks it`,className:`flex-none text-warn`}),(0,k.jsx)(R,{text:e.text,tip:e.endpoint?`${e.text} · checked by ${e.endpoint}`:e.text})]})}),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`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,k.jsx)(`td`,{className:p(`px-4 py-2`,`hidden max-w-0 font-mono text-[13px] text-ink-2 @xl:table-cell`),children:(0,k.jsx)(R,{text:e.where})}),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`hidden max-w-0 text-[13px] text-ink-2 @2xl:table-cell`),children:e.nearest?(0,k.jsx)(R,{text:`${e.nearest.name} (${F(e.nearest.score)})`,tip:`${F(e.nearest.score)} of the rule's words are in ${e.nearest.name}`}):`–`}),(0,k.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`rule`)})]},e.id))})]}),H===`signal`&&(l.history.state===`ok`?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(b,{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,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[50%]`),children:`Test`}),(0,k.jsx)(`th`,{className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Passes`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Since`}),(0,k.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:l.quiet.map(e=>(0,k.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`max-w-0`),children:(0,k.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(n,{size:15,"aria-label":`Always passed`,className:`flex-none text-muted`}),(0,k.jsx)(R,{text:e.name,tip:e.file?`${e.name} · ${e.file}`:e.name})]})}),(0,k.jsx)(`td`,{className:p(Q,`text-muted`),children:e.runs}),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`hidden text-[13px] whitespace-nowrap text-muted @xl:table-cell`),"data-tip":e.since?T(e.since):void 0,children:e.since?w(e.since):`–`}),(0,k.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`test`)})]},e.key))}),(0,k.jsx)(b,{label:`Tests whose file is gone`,placeholder:`Find a test or file`,empty:`Every test file the history names is in the test repository (${l.files.count} files, listed by ${l.files.by===`git`?`git`:`walking the folder`}).`,head:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[40%]`),children:`Test`}),(0,k.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`File`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Last run`}),(0,k.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:l.gone.map(e=>(0,k.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`max-w-0`),children:(0,k.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(i,{size:15,"aria-label":`Its file is gone`,className:`flex-none text-fail`}),(0,k.jsx)(R,{text:e.name})]})}),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`max-w-0 font-mono text-[13px] text-ink-2`),children:(0,k.jsx)(R,{text:e.file})}),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`hidden text-[13px] whitespace-nowrap text-muted @xl:table-cell`),"data-tip":e.last?T(e.last):void 0,children:e.last?w(e.last):`–`}),(0,k.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`test`)})]},e.key))})]}):(0,k.jsx)(L,{part:l.history,what:`test history`,action:{label:`Regression`,to:g(`regression`)}})),H===`duplicates`&&(0,k.jsx)(b,{label:`Tests that read alike`,placeholder:`Find a test, recording or case`,empty:`No two tests, recordings or test cases share ${F(l.threshold)} of their words (${l.compared} pairs compared).`,head:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Alike`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[30%]`),children:`First`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[30%]`),children:`Second`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Shared words`}),(0,k.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:l.duplicates.map(e=>(0,k.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,k.jsx)(`td`,{className:p(Q,`pl-4`,e.score>=.85?`text-warn`:`text-muted`),children:(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,k.jsx)(a,{size:14,"aria-hidden":`true`}),F(e.score)]})}),[e.a,e.b].map((e,t)=>(0,k.jsxs)(`td`,{className:p(`px-4 py-2`,`max-w-0`),children:[(0,k.jsx)(R,{text:e.name,tip:`${M[e.kind]}: ${e.name}${e.where?` · ${e.where}`:``}`}),(0,k.jsx)(`span`,{className:`block text-[13px] text-muted`,children:M[e.kind]})]},t)),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`hidden max-w-0 text-[13px] text-ink-2 @2xl:table-cell`),children:(0,k.jsx)(R,{text:e.shared.join(`, `)})}),(0,k.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`pair`)})]},`${e.a.kind}:${e.a.key}|${e.b.kind}:${e.b.key}`))}),H===`cases`&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsx)(`span`,{className:`text-[13px] font-medium`,children:`Test management`}),(0,k.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:l.sources.map(e=>(0,k.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[e.connected?(0,k.jsx)(n,{size:15,"aria-label":`Connected`,className:`flex-none text-pass`}):(0,k.jsx)(r,{size:15,"aria-label":`Not connected`,className:`flex-none text-muted`}),(0,k.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,k.jsx)(`span`,{className:`text-ink-2`,children:e.connected?e.scopes.length?e.scopes.map(e=>`${e.scope}: ${e.cases} read ${w(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,k.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),X&&q(()=>O.readCases(X,K.trim()),`Test cases read.`)},children:[(0,k.jsx)(ne,{size:`sm`,"aria-label":`Source`,value:X,onChange:e=>se(e.target.value),children:Y.map(e=>(0,k.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,k.jsx)(te,{size:`sm`,"aria-label":`Scope`,placeholder:X&&X!==`jira`?P[X]:``,value:K,maxLength:80,onChange:e=>ce(e.target.value),className:`w-full max-w-[240px] flex-[0_1_240px]`}),(0,k.jsxs)(y,{size:`sm`,type:`submit`,disabled:A||!K.trim(),"data-tip":`Read the test cases`,children:[(0,k.jsx)(c,{"aria-hidden":`true`}),`Import`]})]}),l.cases.length?(0,k.jsx)(b,{label:`Test cases`,placeholder:`Find a test case by id or title`,resetKey:G,empty:`Nothing matches.`,tools:(0,k.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,k.jsx)(v,{items:[{id:`manual`,label:`Not automated`,n:Z,alert:!0},{id:`automated`,label:`Automated`,n:l.cases.length-Z},{id:`all`,label:`All`,n:l.cases.length}],value:G,onChange:ae})}),head:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Case`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[36%]`),children:`Title`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Source`}),(0,k.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Automated`}),(0,k.jsx)(`th`,{className:p(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Test`}),(0,k.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:de.map(e=>(0,k.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`font-mono text-[13px] whitespace-nowrap`),children:/^https?:\/\//i.test(e.url)?(0,k.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id}):e.id}),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`max-w-0`),children:(0,k.jsx)(R,{text:e.title||`–`})}),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`hidden text-[13px] whitespace-nowrap @xl:table-cell`),"data-tip":`From ${e.scope}`,children:N[e.source]}),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`text-[13px] whitespace-nowrap`),children:(0,k.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,k.jsx)(n,{size:15,"aria-hidden":`true`,className:`text-pass`}):(0,k.jsx)(r,{size:15,"aria-hidden":`true`,className:`text-muted`}),e.automated?`Yes`:`No`]})}),(0,k.jsx)(`td`,{className:p(`px-4 py-2`,`hidden max-w-0 text-[13px] text-ink-2 @2xl:table-cell`),children:e.test?(0,k.jsx)(R,{text:e.test,tip:e.file?`${e.test} · ${e.file}`:e.test}):`–`}),(0,k.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:!e.automated&&J(e.draft,`test case`)})]},`${e.source}|${e.id}`))}):(0,k.jsx)(m,{icon:ee,title:`No test cases yet`,action:(0,k.jsxs)(`a`,{className:f({size:`sm`}),href:g(`settings`,`integrations`),"data-tip":`Open Settings, Integrations`,children:[(0,k.jsx)(s,{"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{z as TestDebt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{An as e,Fn as t,Ir as n,Jt as r,Kn as i,M as a,N as o,Nr as s,P as c,R as l,Rn as u,U as d,Wn as f,a as p,at as m,b as h,dr as g,en as _,er as v,gr as y,it as b,jr as x,m as ee,nr as te,o as S,sr as C,tn as w,w as T,xr as E,yr as D,zr as ne}from"./line-icons-C_amZ5-o.js";import{$t as re,B as ie,V as O,a as k,c as A,f as ae,h as j,l as M,o as N,ot as P,p as F,st as I,t as oe,z as L}from"./filters-CVzIOjPG.js";import{$ as R,Q as z,Vt as B,X as V,Z as H,bn as se,bt as ce,et as U,it as le,n as ue,nt as de,o as fe,ot as pe,rt as W}from"./frame-VTMu7MoC.js";import{_ as me,r as G,s as K}from"./index-nuLrB-Rb.js";import{_ as he}from"./qualityParts-CGKSK9Dq.js";import{t as ge}from"./AgentWork-BhepbEeU.js";var q=ne(n(),1),J={view:()=>P(`GET`,`/api/testmgmt`),cases:()=>P(`GET`,`/api/testmgmt/cases`),case:e=>P(`GET`,`/api/testmgmt/case/${encodeURIComponent(e).replace(/%3A/gi,`:`)}`),sync:()=>P(`POST`,`/api/testmgmt/sync`),schedule:()=>P(`GET`,`/api/testmgmt/schedule`),setSchedule:e=>P(`POST`,`/api/testmgmt/schedule`,e),gaps:()=>P(`GET`,`/api/testmgmt/gaps`),tags:()=>P(`GET`,`/api/testmgmt/tags`),tag:(e,t=!1)=>P(`POST`,`/api/testmgmt/tags`,{...e,...t?{confirmed:!0}:{}}),suites:()=>P(`GET`,`/api/testmgmt/suites`),suite:e=>P(`GET`,`/api/testmgmt/suites/${encodeURIComponent(e)}`),buildSuite:(e,t)=>P(`POST`,`/api/testmgmt/suites/agent`,{request:e,...t?{open:t}:{}}),saveSuite:e=>P(`POST`,`/api/testmgmt/suites`,e),deleteSuite:e=>P(`POST`,`/api/testmgmt/suites/${encodeURIComponent(e)}/delete`,{confirmed:!0}),runSuite:(e,t,n=!1)=>P(`POST`,`/api/testmgmt/suites/${encodeURIComponent(e)}/run`,{...t,...n?{confirmed:!0}:{}}),run:(e,t,n=!1)=>P(`POST`,`/api/testmgmt/run`,{keys:e,...t?{env:t}:{},...n?{confirmed:!0}:{}}),job:()=>P(`GET`,`/api/testmgmt/job`),writeBack:(e,t,n,r)=>P(`POST`,`/api/testmgmt/writeback/${e}`,{keys:t,...r?{tags:r}:{},...n?{digest:n}:{}}),suiteTracker:(e,t,n)=>P(`POST`,`/api/testmgmt/suites/${encodeURIComponent(e)}/tracker`,{...t?{target:t}:{},...n?{digest:n}:{}}),stop:()=>P(`POST`,`/api/testmgmt/stop`),tests:()=>P(`GET`,`/api/testmgmt/tests`),discoveryPlan:()=>P(`GET`,`/api/testmgmt/discover`),discover:e=>P(`POST`,`/api/testmgmt/discover`,{digest:e}),link:e=>P(`POST`,`/api/testmgmt/links`,{changes:e}),setMain:(e,t)=>P(`POST`,`/api/testmgmt/links/main`,{case:e,test:t}),proposeLinks:(e=[])=>P(`POST`,`/api/testmgmt/links/propose`,{keys:e}),ask:(e,t,n,r)=>P(`POST`,`/api/testmgmt/ask`,{intent:e,keys:t,...n?{words:n}:{},...r?.length?{stories:r}:{}}),readStories:e=>P(`POST`,`/api/testmgmt/stories`,{scope:e})},_e={automated:`Automated`,not_automated:`Not automated`,pending:`Pending`,known_defect:`Known defect`,needs_attention:`Needs attention`},ve={mapping:`ForgeQE's mapping`,manual:`Linked by a person`,attribute:`Its marker or attribute names the case`,tracker:`The case's system names it`,agent:`Linked by the mapping agent`,name:`The case's id is in its name or tags`},ye={framework:`Listed by its framework`,code:`Read from the code`,runs:`Known from runs`},Y={passed:`Passed`,failed:`Failed`,blocked:`Blocked`,not_run:`Not run`},X=re();function be({title:e,about:t,onClose:n,children:r,footer:i}){return(0,X.jsxs)(`aside`,{"aria-label":e,className:`flex w-full flex-none flex-col border-t border-line-soft bg-surface-muted xl:sticky xl:top-0 xl:h-(--screen) xl:w-[320px] 2xl:w-[380px] xl:border-t-0 xl:border-l`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-line-soft px-6 py-4`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,X.jsx)(`h2`,{className:`m-0 text-[20px] font-semibold`,children:e}),(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:t})]}),n&&(0,X.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Close the ${e}`,"data-tip":`Close`,onClick:n,children:(0,X.jsx)(s,{"aria-hidden":`true`})})]}),(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 py-6`,children:r}),i&&(0,X.jsx)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft px-6 py-4`,children:i})]})}function xe({title:e,about:t,looking:n,context:r,suggestions:a,placeholder:o,onClose:s}){let[c,l]=(0,q.useState)(null),[u,d]=(0,q.useState)(``),[f,p]=(0,q.useState)(!1),[m,h]=(0,q.useState)(``),[g,_]=(0,q.useState)(!1),v=async(e,t,n,r,i)=>{p(!0),h(``);try{let{request:a}=await J.ask(e,t,r,i),{id:o}=await I.start(a,{});l({id:o,said:n}),_(!1),d(``)}catch(e){h(e.message)}finally{p(!1)}};return(0,X.jsxs)(be,{title:e,about:t,onClose:s,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:a.map(e=>(0,X.jsxs)(L,{size:`sm`,disabled:f||!!e.disabled,"data-tip":e.disabled??e.label,onClick:()=>void v(e.intent,e.keys,e.label,void 0,e.stories),children:[(0,X.jsx)(e.icon,{"aria-hidden":`true`}),e.label]},e.label))}),(0,X.jsxs)(`form`,{className:`flex items-end gap-2`,onSubmit:e=>{e.preventDefault(),u.trim()&&v(`ask`,a[0]?.keys.slice(0,50)??[],u.trim(),u.trim())},children:[(0,X.jsxs)(`label`,{className:`sr-only`,htmlFor:`tm-agent-words`,children:[`Message the `,e]}),(0,X.jsx)(`textarea`,{id:`tm-agent-words`,rows:2,maxLength:1e3,value:u,placeholder:o,onChange:e=>d(e.target.value),className:`min-h-11 flex-1 resize-none rounded-[10px] border border-line bg-bg px-4 py-2 text-[13px] text-ink outline-none focus:border-accent`}),(0,X.jsx)(L,{size:`icon`,variant:`primary`,type:`submit`,disabled:f||!u.trim(),"aria-label":`Send`,"data-tip":`Send`,children:(0,X.jsx)(i,{"aria-hidden":`true`})})]})]}),children:[(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-4 text-center`,children:[(0,X.jsx)(j,{state:f||c&&!g?`thinking`:`working`,px:96,label:f?`Starting`:c&&!g?`Working`:`Ready`}),(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:c?g?`Done. Ask again, or open the chat.`:`Working on it…`:n}),r.length>0&&(0,X.jsx)(`span`,{className:`flex flex-wrap justify-center gap-2`,children:r.map(e=>(0,X.jsx)(`span`,{className:`rounded-[8px] border border-line bg-bg px-2 text-[13px] text-ink-2`,children:e},e))}),c&&(0,X.jsx)(`p`,{className:`m-0 text-[16px] leading-relaxed text-ink-2`,children:c.said})]}),m&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:m}),c?(0,X.jsx)(ge,{id:c.id,label:`The ${e} at work`,onEnd:()=>_(!0)},c.id):(0,X.jsxs)(`p`,{className:O(`m-0 text-center text-[13px] text-muted`),children:[`Pick what to do below, or say it in your own words. It works in a chat you can open: `,(0,X.jsx)(`a`,{href:F(`chats`),children:`Chats`}),`.`]})]})}var Se={automation:`Mark automated in their tracker`,tags:`Write ForgeQE's tags to their tracker`,untag:`Take ForgeQE's tags off in their tracker`},Ce={automation:`Each case's tracker records its automated test: Azure DevOps' Associated Automation, or the automated label on a Jira or Xray test. Only cases whose test ForgeQE knows, from its mapping or a link, are marked.`,tags:`ForgeQE's own tags are added to each case's tags in Azure DevOps, or its labels in Jira. Tags the case already has stay; nothing is taken away.`,untag:`ForgeQE's own tags are taken off each case's tags in Azure DevOps, or its labels in Jira. Only a tag ForgeQE keeps for the case is taken off; the tracker's other tags stay.`},we=e=>e.system===`azure_devops`?`Azure DevOps plan ${e.plan}`:`Xray Test Set in ${e.project}`,Te=e=>e.system===`azure_devops`?`ado:${e.plan}`:`xray:${e.project}`,Ee=e=>e?.url&&/^https:\/\//i.test(e.url)?e.url:void 0,De=e=>e.system===`azure_devops`?`Azure DevOps suite ${e.suite} in plan ${e.plan}`:`Xray Test Set ${e.key}`;function Oe({plan:e,outcome:t}){let n=new Map((t?.failed??[]).map(e=>[e.key,e.error])),r=new Set((t?.done??[]).map(e=>e.key)),i=(e,t,i=!1)=>(0,X.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-2 first:border-t-0`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-2`,children:[r.has(e.key)&&(0,X.jsx)(a,{size:14,"aria-label":`Written`,className:`flex-none text-pass`}),n.has(e.key)&&(0,X.jsx)(l,{size:14,"aria-label":`Refused`,className:`flex-none text-fail`}),e.key!==`suite`&&(0,X.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.key.replace(/^[a-z_]+:/,``)}),(0,X.jsx)(`span`,{className:i?`text-muted`:`text-ink-2`,children:e.what})]}),n.has(e.key)&&(0,X.jsx)(`span`,{className:`text-fail [overflow-wrap:anywhere]`,children:n.get(e.key)})]},`${e.key}-${t}`);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 text-[13px]`,children:[e.changes.length?(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.changes.map((e,t)=>i(e,t))}):(0,X.jsx)(`p`,{className:`m-0 text-ink-2`,children:`Nothing to write: the trackers already say so.`}),e.skipped.length>0&&(0,X.jsxs)(`details`,{children:[(0,X.jsxs)(`summary`,{className:`cursor-pointer text-muted`,children:[`Left out: `,e.skipped.length]}),(0,X.jsx)(`ul`,{className:`m-0 mt-2 flex list-none flex-col p-0`,children:e.skipped.map((e,t)=>i(e,t,!0))})]})]})}function ke(e,t,n){let[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(!1);return(0,q.useEffect)(()=>{i(null),o(null),c(``),e&&e().then(e=>i(e??null),e=>c(e.message))},[e]),{plan:r,outcome:a,error:s,busy:l,go:async()=>{if(r){u(!0),c(``);try{let e=await t(r.digest);e&&(o(e),n(`Wrote ${e.done.length}${e.failed.length?`; the tracker refused ${e.failed.length}`:``}.`))}catch(e){c(e.message)}finally{u(!1)}}}}}function Ae({kind:e,keys:t,tags:n,onClose:r,onDone:i}){let[a,o]=(0,q.useState)(null);(0,q.useEffect)(()=>o(e?()=>()=>J.writeBack(e,t,void 0,n).then(e=>e.plan):null),[e,t,n]);let c=ke(a,r=>J.writeBack(e,t,r,n).then(e=>e.outcome),i);return(0,X.jsx)(B,{open:!!e,onClose:r,title:e?Se[e]:``,description:e?Ce[e]:``,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(L,{onClick:r,children:[(0,X.jsx)(s,{"aria-hidden":`true`}),c.outcome?`Close`:`Cancel`]}),!c.outcome&&(0,X.jsxs)(L,{variant:`primary`,disabled:c.busy||!c.plan?.changes.length,onClick:()=>void c.go(),"data-tip":`Write these changes`,children:[e===`untag`?(0,X.jsx)(b,{"aria-hidden":`true`}):(0,X.jsx)(E,{"aria-hidden":`true`}),c.busy?`Writing…`:`${e===`untag`?`Take off`:`Write`} ${c.plan?.changes.length??``}`]})]}),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[!c.plan&&!c.error&&(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Working out what would change…`}),c.error&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:c.error}),c.plan&&(0,X.jsx)(Oe,{plan:c.plan,outcome:c.outcome})]})})}function je({open:e,suite:t,targets:n,onClose:r,onDone:i}){let[a,o]=(0,q.useState)(``),c=t.tracker?void 0:n.find(e=>Te(e)===(a||(n[0]?Te(n[0]):``))),[l,u]=(0,q.useState)(null);(0,q.useEffect)(()=>u(e&&(t.tracker||c)?()=>()=>J.suiteTracker(t.id,c).then(e=>e.plan):null),[e,t.id,t.tracker,c&&Te(c)]);let d=ke(l,e=>J.suiteTracker(t.id,c,e).then(e=>e.outcome),i),f=t.tracker;return(0,X.jsx)(B,{open:e,onClose:r,title:f?`Keep ${t.name} in step`:`Keep ${t.name} in a tracker`,description:f?`It is ${De(f)}. Cases the suite gained are added there, and cases it lost are taken out.`:`The suite is made in the tracker with its cases, so the team sees it there. Later, Keep in step makes it match the suite again.`,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(L,{onClick:r,children:[(0,X.jsx)(s,{"aria-hidden":`true`}),d.outcome?`Close`:`Cancel`]}),!d.outcome&&(0,X.jsxs)(L,{variant:`primary`,disabled:d.busy||!d.plan?.changes.length,onClick:()=>void d.go(),children:[(0,X.jsx)(T,{"aria-hidden":`true`}),d.busy?`Writing…`:f?`Keep in step`:`Make it there`]})]}),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-[13px]`,children:[!f&&(n.length?(0,X.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Where`,(0,X.jsx)(N,{value:c?Te(c):``,onChange:e=>o(e.target.value),children:n.map(e=>(0,X.jsx)(`option`,{value:Te(e),children:we(e)},Te(e)))})]}):(0,X.jsx)(`p`,{className:`m-0 text-ink-2`,children:`This suite's cases are in no connected Azure DevOps plan or Xray project. Connect one in Settings › Integrations.`})),(f||c)&&!d.plan&&!d.error&&(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-muted`,children:`Working out what would change…`}),d.error&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:d.error}),d.plan&&(0,X.jsx)(Oe,{plan:d.plan,outcome:d.outcome}),d.outcome&&!d.outcome.failed.length&&(0,X.jsx)(A,{tone:`pass`,children:`Done`})]})})}var Me={automated:a,not_automated:o,pending:c,known_defect:D,needs_attention:D},Ne={passed:`pass`,failed:`fail`,blocked:`warn`,not_run:`neutral`};function Z({text:e,tip:t,className:n}){return(0,X.jsx)(`span`,{"data-tip":t??e,className:O(`block truncate`,n),children:e})}function Pe({a:e}){let t=Me[e];return(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-[13px] whitespace-nowrap`,children:[(0,X.jsx)(t,{size:15,"aria-hidden":`true`,className:O(`flex-none`,e===`automated`?`text-pass`:e===`known_defect`?`text-fail`:e===`not_automated`?`text-muted`:`text-warn`)}),_e[e]]})}function Fe({o:e}){return(0,X.jsx)(A,{tone:Ne[e],icon:e!==`not_run`,children:Y[e]})}function Ie({runs:e}){return e.length?(0,X.jsx)(`span`,{role:`img`,"aria-label":`Last runs: ${e.map(e=>e===`p`?`passed`:`failed`).join(`, `)}`,className:`inline-flex items-end gap-1`,children:e.map((e,t)=>(0,X.jsx)(`span`,{className:O(`inline-block h-4 w-2 rounded-[2px]`,e===`p`?`bg-pass`:`bg-fail`)},t))}):(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:`–`})}function Q({tags:e,max:t=3}){return e.length?(0,X.jsxs)(`span`,{className:`inline-flex flex-wrap gap-1`,children:[e.slice(0,t).map(e=>(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-[6px] bg-surface-strong px-2 text-[13px] text-ink-2`,children:[(0,X.jsx)(g,{size:11,"aria-hidden":`true`}),e]},e)),e.length>t&&(0,X.jsxs)(`span`,{className:`text-[13px] text-muted`,"data-tip":e.slice(t).join(`, `),children:[`+`,e.length-t]})]}):null}function Le({points:e,label:t,format:n=e=>String(e),height:r=160}){if(e.length<2)return(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`The trend starts after a second day of numbers: each visit of Test management keeps the day's.`});let i=r,a=Math.min(...e.map(e=>e.y)),o=Math.max(...e.map(e=>e.y)),s=Math.max(0,a-(o-a||1)*.2),c=o+(o-a||1)*.2,l=t=>8+t*584/(e.length-1),u=e=>i-20-(e-s)/(c-s||1)*(i-36),d=e.map((e,t)=>`${l(t).toFixed(1)},${u(e.y).toFixed(1)}`),f=e.at(-1);return(0,X.jsxs)(`figure`,{className:`m-0 flex flex-col gap-1`,children:[(0,X.jsxs)(`svg`,{viewBox:`0 0 600 ${i}`,role:`img`,"aria-label":`${t}: from ${n(e[0].y)} on ${e[0].x} to ${n(f.y)} on ${f.x}`,className:`h-auto w-full text-accent`,children:[[.25,.5,.75].map(e=>(0,X.jsx)(`line`,{x1:`0`,x2:600,y1:(i-20)*e+4,y2:(i-20)*e+4,className:`stroke-line-soft`,strokeWidth:`1`},e)),(0,X.jsx)(`path`,{d:`M${d.join(` L`)} L${l(e.length-1)},${i-20} L${l(0)},${i-20} Z`,fill:`currentColor`,fillOpacity:`0.1`}),(0,X.jsx)(`polyline`,{points:d.join(` `),fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`}),(0,X.jsx)(`circle`,{cx:l(e.length-1),cy:u(f.y),r:`4`,fill:`currentColor`,className:`stroke-bg`,strokeWidth:`2`})]}),(0,X.jsxs)(`figcaption`,{className:`flex justify-between text-[13px] text-muted`,children:[(0,X.jsx)(`span`,{children:e[0].x}),(0,X.jsxs)(`span`,{className:`font-medium text-ink`,children:[n(f.y),` now`]}),(0,X.jsx)(`span`,{children:f.x})]})]})}function Re({items:e,series:t,label:n}){let r=Math.max(1,...e.flatMap(e=>e.values));return(0,X.jsxs)(`figure`,{className:`m-0 flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`flex flex-wrap gap-4 text-[13px] text-ink-2`,children:t.map(e=>(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:O(`inline-block size-[10px] rounded-[3px]`,e.className),"aria-hidden":`true`}),e.name]},e.name))}),(0,X.jsx)(`div`,{role:`img`,"aria-label":`${n}: ${e.map(e=>`${e.x} ${e.values.join(` and `)}`).join(`; `)}`,className:`flex h-[140px] items-end gap-2 border-b border-line`,children:e.map(e=>(0,X.jsx)(`span`,{className:`flex h-full flex-1 items-end justify-center gap-1`,"data-tip":`${e.x}: ${e.values.map((e,n)=>`${t[n]?.name.toLowerCase()} ${e}`).join(`, `)}`,children:e.values.map((e,n)=>(0,X.jsx)(`span`,{className:O(`w-full max-w-[14px] rounded-t-[4px]`,t[n]?.className),style:{height:`${Math.max(e?3:0,e/r*100)}%`}},n))},e.x))}),(0,X.jsxs)(`span`,{className:`flex justify-between text-[13px] text-muted`,children:[(0,X.jsx)(`span`,{children:e[0]?.x}),(0,X.jsx)(`span`,{children:e.at(-1)?.x})]})]})}function ze({label:e,part:t,whole:n,className:r=`bg-accent`}){let i=n?Math.round(t/n*100):0;return(0,X.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,140px)_1fr_auto] items-center gap-4 text-[13px]`,children:[(0,X.jsx)(Z,{text:e,className:`text-ink-2`}),(0,X.jsx)(`span`,{className:`h-2 overflow-hidden rounded-full bg-surface-strong`,role:`img`,"aria-label":`${e}: ${t} of ${n}`,children:(0,X.jsx)(`span`,{className:O(`block h-full rounded-full`,r),style:{width:`${i}%`}})}),(0,X.jsxs)(`span`,{className:`w-[86px] text-right tabular-nums text-ink-2`,children:[t,` of `,n]})]})}function Be({open:t,onClose:n,title:r,preview:i,onStarted:a}){let[o,c]=(0,q.useState)(null),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(null),[p,m]=(0,q.useState)(``),[h,g]=(0,q.useState)(!1);(0,q.useEffect)(()=>{t&&(f(null),m(``),J.suites().then(e=>{c({list:e.environments,...e.active?{active:e.active}:{}}),u(e.active&&e.environments.includes(e.active)?e.active:e.environments[0]??``)},e=>m(e.message)))},[t]),(0,q.useEffect)(()=>{t&&o!==null&&i(l||void 0,!1).then(e=>{f(e.preview??null),m(``)},e=>m(e.message))},[t,l,o]);let _=async()=>{g(!0);try{await i(l||void 0,!0),a(),n()}catch(e){m(e.message)}finally{g(!1)}};return(0,X.jsx)(B,{open:t,onClose:n,title:r,description:`ForgeQE runs these with forgeqe suite, on the environment you pick here. Results go to Runs and back to each case's system, as your settings say.`,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(L,{onClick:n,children:[(0,X.jsx)(s,{"aria-hidden":`true`}),`Cancel`]}),(0,X.jsxs)(L,{variant:`primary`,disabled:h||!d,onClick:()=>void _(),"data-tip":`Start the run`,children:[(0,X.jsx)(e,{"aria-hidden":`true`}),`Run `,d?d.cases:``]})]}),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-[13px]`,children:[o&&o.list.length>0&&(0,X.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Environment`,(0,X.jsx)(N,{value:l,onChange:e=>u(e.target.value),children:o.list.map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))})]}),d&&(0,X.jsxs)(`p`,{role:`status`,className:`m-0 text-ink-2`,children:[d.cases,` test case`,d.cases===1?``:`s`,` on `,d.env??`the active environment`,`.`]}),p&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:p})]})})}var Ve=e=>e.lastRun.outcome===`failed`||e.lastRun.outcome===`blocked`,He=e=>F(`test-management`,`cases`,encodeURIComponent(e));function Ue({cases:e,onChanged:t}){let[n,r]=(0,q.useState)(null),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(`all`),[c,l]=(0,q.useState)(!1),[u,p]=(0,q.useState)(null),m=()=>J.tests().then(e=>{r(e),a(``)},e=>a(e.message));(0,q.useEffect)(()=>{m()},[]),(0,q.useEffect)(()=>{if(!n?.busy)return;let e=setInterval(()=>void m(),3e3);return()=>clearInterval(e)},[n?.busy]),Ge(n?.busy??null,()=>t(`Done: the tests and their links are up to date.`));let h=(0,q.useMemo)(()=>new Map(e.map(e=>[e.key,e])),[e]);if(i)return(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:i});if(!n)return(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`});let g=n.tests.filter(e=>e.uid),y={all:g.length,unlinked:g.filter(e=>!e.cases.length).length,linked:g.filter(e=>e.cases.length).length,code:g.filter(e=>e.via===`code`).length},b=g.filter(e=>o===`all`||(o===`unlinked`?!e.cases.length:o===`linked`?e.cases.length>0:e.via===`code`)),x=async()=>{try{t(`The mapping agent is looking at ${(await J.proposeLinks()).cases} cases with no test.`),m()}catch(e){t(e.message)}};return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(L,{variant:`primary`,onClick:()=>l(!0),disabled:!!n.busy,children:[(0,X.jsx)(f,{"aria-hidden":`true`}),`Discover tests`]}),(0,X.jsxs)(L,{onClick:()=>void x(),disabled:!!n.busy||!g.length,"data-tip":`The mapping agent links cases that have no test to the tests that check them`,children:[(0,X.jsx)(v,{"aria-hidden":`true`}),`Link with the agent`]}),(0,X.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[n.busy?n.busy.what===`discover`?`Discovering tests, started ${G(n.busy.started)}…`:`The mapping agent is at work, started ${G(n.busy.started)}…`:n.discovery?`Discovered ${G(n.discovery.at)}.`:`Not discovered yet: these are read from the code.`,n.proposed>0&&` ${n.proposed} link${n.proposed===1?``:`s`} proposed, waiting on the cases' pages.`]})]}),n.error&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:n.error}),n.discovery&&n.discovery.projects.length>0&&(0,X.jsx)(Ke,{projects:n.discovery.projects}),g.length?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,X.jsx)(oe,{items:[{id:`all`,label:`All`,n:y.all},{id:`unlinked`,label:`No test case`,n:y.unlinked},{id:`linked`,label:`Linked`,n:y.linked},{id:`code`,label:`Read from the code`,n:y.code,tip:`Their framework was not asked, or could not list them`}],value:o,onChange:s})}),(0,X.jsx)(V,{label:`Automated tests`,placeholder:`Find a test by id, name, file or tag`,resetKey:o,empty:`No test matches.`,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:O(R,`w-[45%]`),children:`Test`}),(0,X.jsx)(`th`,{className:O(R,`hidden @2xl:table-cell`),children:`Framework`}),(0,X.jsx)(`th`,{className:R,children:`Test cases`}),(0,X.jsx)(`th`,{className:O(R,`hidden @3xl:table-cell`),children:`Tags`}),(0,X.jsx)(`th`,{className:O(R,`hidden @2xl:table-cell`),children:`Last runs`}),(0,X.jsx)(`th`,{className:R,children:(0,X.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:b.map(t=>(0,X.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,X.jsxs)(`td`,{className:O(H,`max-w-0`),children:[(0,X.jsx)(Z,{text:t.name,tip:t.nativeId??t.name}),(0,X.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-x-2 text-[13px] text-muted`,children:[(0,X.jsx)(`span`,{className:`font-mono text-accent-fg`,children:t.uid}),t.file&&(0,X.jsxs)(`span`,{className:`truncate font-mono`,children:[t.file,t.line?`:${t.line}`:``]}),t.flaky&&(0,X.jsx)(A,{tone:`warn`,children:`Flaky`})]})]}),(0,X.jsx)(`td`,{className:O(H,`hidden text-[13px] @2xl:table-cell`),children:(0,X.jsxs)(`span`,{className:`flex flex-col`,children:[(0,X.jsxs)(`span`,{children:[We[t.framework??`code`],t.framework===`gherkin`?`, ${t.runner??`no runner found`}`:``]}),(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:ye[t.via??`runs`]})]})}),(0,X.jsx)(`td`,{className:O(H,`text-[13px]`),children:t.cases.length?(0,X.jsxs)(`span`,{className:`flex flex-wrap gap-x-2`,children:[t.cases.slice(0,4).map(e=>(0,X.jsx)(`a`,{href:He(e),className:`font-mono`,"data-tip":h.get(e)?.title,children:h.get(e)?.id??e},e)),t.cases.length>4&&(0,X.jsxs)(`span`,{className:`text-muted`,children:[`+`,t.cases.length-4]})]}):(0,X.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,X.jsx)(`td`,{className:O(H,`hidden @3xl:table-cell`),children:(0,X.jsx)(Q,{tags:t.tags})}),(0,X.jsx)(`td`,{className:O(H,`hidden @2xl:table-cell`),children:(0,X.jsx)(Ie,{runs:t.runs})}),(0,X.jsx)(`td`,{className:O(H,`text-right`),children:(0,X.jsxs)(L,{size:`sm`,onClick:()=>p(t),"aria-label":`Link ${t.name} to a test case`,disabled:!e.length,children:[(0,X.jsx)(_,{"aria-hidden":`true`}),`Link`]})})]},t.uid))})]}):(0,X.jsx)(M,{icon:d,title:`No automated test found yet`,children:`Discover tests asks each test project's framework (pytest, .NET, Playwright, Vitest, Jest, Mocha, Robot Framework) for its tests. Set the automation repository in Settings › Code first.`}),(0,X.jsx)(qe,{open:c,onClose:()=>l(!1),onStarted:()=>{l(!1),t(`Discovering tests: each project's framework lists its tests.`),m()}}),(0,X.jsx)(Je,{open:!!u,title:`Link to a test case`,description:u?`Pick the test case ${u.name} checks. It is kept in .forgeqe/testmgmt/links.json, shared with the team.`:void 0,items:e.filter(e=>!u?.cases.includes(e.key)).map(e=>({id:e.key,label:e.title,sub:e.id})),onClose:()=>p(null),onPick:async e=>{u?.uid&&(await J.link([{case:e,test:u.uid,action:`link`}]),p(null),t(`Linked ${u.uid} to ${h.get(e)?.id??e}.`),m())}})]})}var We={pytest:`pytest`,dotnet:`.NET`,playwright:`Playwright`,jest:`Jest`,vitest:`Vitest`,mocha:`Mocha`,robot:`Robot Framework`,gherkin:`Gherkin`,code:`Code`};function Ge(e,t){let[n,r]=(0,q.useState)(!1);return(0,q.useEffect)(()=>{e?r(!0):n&&(r(!1),t())},[e]),n}function Ke({projects:e}){return(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:e.map((e,t)=>(0,X.jsxs)(`li`,{className:`flex flex-wrap items-start gap-2`,children:[e.ok?(0,X.jsx)(a,{size:14,"aria-label":`Listed`,className:`mt-1 flex-none text-pass`}):(0,X.jsx)(D,{size:14,"aria-label":`Not listed`,className:`mt-1 flex-none text-warn`}),(0,X.jsxs)(`span`,{children:[e.label,` in `,e.dir?(0,X.jsx)(`span`,{className:`font-mono`,children:e.dir}):`the repository's root`,`: `,e.ok?`${e.tests} test${e.tests===1?``:`s`}`:`not listed by its framework, read from the code`,e.error&&(0,X.jsx)(`span`,{className:`block text-muted [overflow-wrap:anywhere]`,children:e.error})]})]},`${e.framework}-${e.dir}-${t}`))})}function qe({open:t,onClose:n,onStarted:r}){let[i,a]=(0,q.useState)(null),[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(!1);(0,q.useEffect)(()=>{t&&(a(null),s(``),J.discoveryPlan().then(a,e=>s(e.message)))},[t]);let u=async()=>{if(i){l(!0);try{await J.discover(i.digest),r()}catch(e){s(e.message)}finally{l(!1)}}};return(0,X.jsx)(B,{open:t,onClose:n,title:`Discover tests`,description:`Each test project's framework lists its tests, as a test explorer asks it. This runs the repository's code (pytest imports conftest.py, .NET builds the project) with no secret of ForgeQE's, so look at what will run first.`,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(L,{onClick:n,children:`Cancel`}),(0,X.jsxs)(L,{variant:`primary`,onClick:()=>void u(),disabled:!i||c,children:[(0,X.jsx)(e,{"aria-hidden":`true`}),`Discover`]})]}),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 text-[13px]`,children:[o&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:o}),!i&&!o&&(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-muted`,children:`Finding the test projects…`}),i&&!i.steps.length&&(0,X.jsx)(`p`,{className:`m-0 text-ink-2`,children:`No test project was found whose framework can be asked. Gherkin features and the code are still read.`}),i&&i.steps.length>0&&(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:i.steps.map((e,t)=>(0,X.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(`span`,{children:[We[e.project.framework],` in `,e.project.dir?(0,X.jsx)(`span`,{className:`font-mono`,children:e.project.dir}):`the repository's root`]}),(0,X.jsx)(`code`,{className:`rounded-[8px] bg-surface-strong px-2 py-1 font-mono text-[13px] [overflow-wrap:anywhere]`,children:e.command})]},t))})]})})}function Je({open:e,title:t,description:n,items:r,onClose:i,onPick:a}){let[o,s]=(0,q.useState)(``),[c,u]=(0,q.useState)(``);(0,q.useEffect)(()=>s(``),[e]);let d=async e=>{u(e),s(``);try{await a(e)}catch(e){s(e.message)}finally{u(``)}};return(0,X.jsx)(B,{open:e,onClose:i,title:t,description:n,wide:!0,footer:(0,X.jsx)(L,{onClick:i,children:`Close`}),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[o&&(0,X.jsxs)(`p`,{role:`alert`,className:`m-0 flex items-center gap-2 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[(0,X.jsx)(l,{size:14,"aria-hidden":`true`}),o]}),(0,X.jsx)(V,{label:t,placeholder:`Find by id or words`,resetKey:String(e),empty:`Nothing to pick.`,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:R,children:`Name`}),(0,X.jsx)(`th`,{className:R,children:(0,X.jsx)(`span`,{className:`sr-only`,children:`Pick`})})]}),children:r.map(e=>(0,X.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,X.jsxs)(`td`,{className:O(H,`max-w-0`),children:[(0,X.jsx)(Z,{text:e.label}),e.sub&&(0,X.jsx)(`span`,{className:`block truncate font-mono text-[13px] text-muted`,children:e.sub})]}),(0,X.jsx)(`td`,{className:O(H,`w-24 text-right`),children:(0,X.jsxs)(L,{size:`sm`,onClick:()=>void d(e.id),disabled:!!c,children:[(0,X.jsx)(_,{"aria-hidden":`true`}),`Link`]})})]},e.id))})]})})}var Ye=e=>e&&/^https:\/\//i.test(e)?e:void 0;function Xe({caseKey:t,onRun:n}){let[i,a]=(0,q.useState)(null),[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(null),[u,d]=(0,q.useState)(``);(0,q.useEffect)(()=>{a(null),J.case(t).then(e=>{a(e),s(``)},e=>s(e.message))},[t]);let f=(0,X.jsxs)(`a`,{href:F(`test-management`,`cases`),className:`inline-flex w-fit items-center gap-2 text-[13px]`,children:[(0,X.jsx)(p,{size:14,"aria-hidden":`true`}),`Test cases`]});if(o)return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[f,(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:o})]});if(!i)return(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`});let h=i.case,g=Ye(h.url);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[f,(0,X.jsxs)(`header`,{className:`flex flex-wrap items-start gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_420px] flex-col gap-2`,children:[(0,X.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[(0,X.jsx)(`span`,{className:`font-mono text-accent-fg`,children:h.id}),` · `,h.plans.join(`, `)||`Not in a synced plan`]}),(0,X.jsx)(`h2`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:h.title}),(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[h.priority&&(0,X.jsxs)(A,{tone:h.priority===1?`fail`:h.priority===2?`warn`:`neutral`,icon:!1,children:[`Priority `,h.priority]}),h.state&&(0,X.jsx)(A,{tone:`neutral`,children:h.state}),(0,X.jsx)(Pe,{a:h.automation}),h.origin===`forgeqe`&&(0,X.jsxs)(A,{tone:`running`,icon:!1,children:[(0,X.jsx)(v,{size:12,"aria-hidden":`true`}),`Written by ForgeQE`,h.createdAt?` ${G(h.createdAt)}`:``]})]})]}),(0,X.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[g&&(0,X.jsxs)(`a`,{className:ie(),href:g,target:`_blank`,rel:`noreferrer noopener`,children:[(0,X.jsx)(m,{"aria-hidden":`true`}),`Open in its system`]}),h.how!==`none`&&h.how!==`tracker`&&!!h.test?.file&&h.trackerAutomated!==!0&&(0,X.jsxs)(L,{onClick:()=>l(`automation`),children:[(0,X.jsx)(E,{"aria-hidden":`true`}),`Mark automated in its system`]}),h.ownTags.some(e=>!h.trackerTags.includes(e))&&(0,X.jsxs)(L,{onClick:()=>l(`tags`),children:[(0,X.jsx)(E,{"aria-hidden":`true`}),`Write tags to its system`]}),h.ownTags.some(e=>h.trackerTags.includes(e))&&(0,X.jsxs)(L,{onClick:()=>l(`untag`),children:[(0,X.jsx)(b,{"aria-hidden":`true`}),`Take tags off in its system`]}),(0,X.jsxs)(L,{variant:`primary`,onClick:()=>n([h.key]),children:[(0,X.jsx)(e,{"aria-hidden":`true`}),`Run`]})]})]}),(0,X.jsx)(Ae,{kind:c,keys:[h.key],onClose:()=>l(null),onDone:e=>(d(e),void J.case(t).then(a,()=>{}))}),u&&(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2`,children:u}),(h.stale||h.drift)&&(0,X.jsxs)(`p`,{role:`status`,className:`m-0 flex items-start gap-2 rounded-[12px] bg-warn-soft px-4 py-2 text-[13px] text-warn`,children:[(0,X.jsx)(D,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none`}),(0,X.jsxs)(`span`,{children:[h.stale&&`Its steps changed in its system after its test was written: the next run updates the test. `,h.drift&&(h.trackerAutomated?`Its system marks it automated, but ForgeQE knows no test for it.`:`ForgeQE has a test for it, but its system does not mark it automated.`)]})]}),(0,X.jsxs)(`div`,{className:`grid gap-6 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,X.jsx)(V,{label:`Steps`,search:!1,empty:`Its system holds no steps for it, or it is not in a synced plan.`,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:O(R,`w-10`),children:`#`}),(0,X.jsx)(`th`,{className:R,children:`Action`}),(0,X.jsx)(`th`,{className:R,children:`Expected result`})]}),children:i.steps.map((e,t)=>(0,X.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,X.jsx)(`td`,{className:O(H,`text-[13px] text-muted tabular-nums`),children:t+1}),(0,X.jsx)(`td`,{className:O(H,`text-[13px] [overflow-wrap:anywhere]`),children:e.action}),(0,X.jsx)(`td`,{className:O(H,`text-[13px] text-ink-2 [overflow-wrap:anywhere]`),children:e.expected??`–`})]},t))}),(0,X.jsx)(Ze,{detail:i,onChanged:e=>(d(e),void J.case(t).then(a,()=>{}))})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,X.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6 text-[13px]`,children:[(0,X.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold`,children:`Details`}),(0,X.jsxs)(`dl`,{className:`m-0 grid grid-cols-[96px_1fr] gap-x-4 gap-y-2`,children:[(0,X.jsx)(`dt`,{className:`text-muted`,children:`Last run`}),(0,X.jsxs)(`dd`,{className:`m-0 flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(Fe,{o:h.lastRun.outcome}),h.lastRun.at&&(0,X.jsxs)(`span`,{className:`text-muted`,children:[G(h.lastRun.at),h.lastRun.by===`tracker`?`, in its system`:``]})]}),(0,X.jsx)(`dt`,{className:`text-muted`,children:`Suite`}),(0,X.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:h.suite??`–`}),(0,X.jsx)(`dt`,{className:`text-muted`,children:`Area`}),(0,X.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:h.group??`–`}),(0,X.jsx)(`dt`,{className:`text-muted`,children:`Stories`}),(0,X.jsx)(`dd`,{className:`m-0`,children:h.stories.join(`, `)||`–`}),(0,X.jsx)(`dt`,{className:`text-muted`,children:`Tags`}),(0,X.jsx)(`dd`,{className:`m-0`,children:h.tags.length?(0,X.jsx)(Q,{tags:h.tags,max:10}):`–`}),(0,X.jsx)(`dt`,{className:`text-muted`,children:`Steps`}),(0,X.jsx)(`dd`,{className:`m-0`,children:h.steps})]})]}),(0,X.jsxs)(`section`,{className:`card flex flex-col gap-2 rounded-[14px] border p-6 text-[13px]`,children:[(0,X.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 text-[16px] font-semibold`,children:[(0,X.jsx)(r,{size:16,"aria-hidden":`true`}),`In suites and packs`]}),i.suites.length||h.packs.length?(0,X.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:[i.suites.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(`a`,{href:F(`test-management`,`suites`,e.id),children:e.name})},e.id)),h.packs.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`a`,{href:F(`regression`,e),children:[`Pack `,e]})},e))]}):(0,X.jsx)(`p`,{className:`m-0 text-muted`,children:`In no suite or regression pack.`})]}),i.changes.length>0&&(0,X.jsxs)(`section`,{className:`card flex flex-col gap-2 rounded-[14px] border p-6 text-[13px]`,children:[(0,X.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold`,children:`What ForgeQE did`}),(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:i.changes.map((e,t)=>(0,X.jsxs)(`li`,{className:`[overflow-wrap:anywhere]`,children:[(0,X.jsx)(`span`,{className:`text-muted`,children:G(e.at)}),` `,e.action,e.story?` for ${e.story}`:``,e.reason?`: ${e.reason}`:``]},t))})]})]})]})]})}function Ze({detail:e,onChanged:t}){let n=e.case,[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(!1),[c,l]=(0,q.useState)(``);(0,q.useEffect)(()=>{(n.proposed.length||a)&&J.tests().then(e=>i(e.tests),()=>{})},[n.proposed.length,a]);let u=new Map((r??[]).filter(e=>e.uid).map(e=>[e.uid,e])),f=async(e,r,i)=>{l(``);try{await J.link([{case:n.key,test:e,action:r}]),t(i)}catch(e){l(e.message)}},p=async e=>{l(``);try{t(`${e} is the main test now${(await J.setMain(n.key,e)).mapped?`, and ForgeQE's mapping records it`:``}. Mark automated writes it to the tracker.`)}catch(e){l(e.message)}},m=async()=>{l(``);try{await J.proposeLinks([n.key]),t(`The mapping agent is looking for this case's tests. Open the case again in a moment.`)}catch(e){l(e.message)}};return(0,X.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`h3`,{className:`m-0 flex flex-1 items-center gap-2 text-[16px] font-semibold`,children:[(0,X.jsx)(d,{size:16,"aria-hidden":`true`}),`Automated tests`]}),(0,X.jsxs)(L,{size:`sm`,onClick:()=>o(!0),children:[(0,X.jsx)(_,{"aria-hidden":`true`}),`Link a test`]}),(0,X.jsxs)(L,{size:`sm`,onClick:()=>void m(),"data-tip":`The mapping agent picks the tests that check this case`,children:[(0,X.jsx)(v,{"aria-hidden":`true`}),`Ask the agent`]})]}),c&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:c}),n.tests.length?(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0 text-[13px]`,children:n.tests.map(e=>(0,X.jsxs)(`li`,{className:`flex flex-wrap items-start gap-2 border-t border-line-soft py-2 first:border-t-0`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 [overflow-wrap:anywhere]`,children:[e.name,e.main&&n.tests.length>1&&(0,X.jsx)(`span`,{"data-tip":`What its tracker records as its automated test, and what a run reuses first`,children:(0,X.jsx)(A,{tone:`pass`,icon:!1,children:`Main test`})})]}),(0,X.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-[13px] text-muted`,children:[e.uid&&(0,X.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.uid}),e.file&&(0,X.jsx)(`span`,{className:`font-mono [overflow-wrap:anywhere]`,children:e.file})]}),(0,X.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[ve[e.how],e.why&&e.why!==ve[e.how]?`: ${e.why}`:``]})]}),e.uid&&n.tests.length>1&&!e.main&&(0,X.jsxs)(L,{size:`sm`,variant:`ghost`,onClick:()=>void p(e.uid),"aria-label":`Make ${e.name} the main test`,"data-tip":`Its tracker records this one as the case's automated test`,children:[(0,X.jsx)(C,{"aria-hidden":`true`}),`Make main`]}),e.uid&&e.how!==`mapping`&&(0,X.jsxs)(L,{size:`sm`,variant:`ghost`,onClick:()=>void f(e.uid,`unlink`,`Unlinked ${e.uid}. It is not linked again by itself.`),"aria-label":`Unlink ${e.name}`,children:[(0,X.jsx)(s,{"aria-hidden":`true`}),`Unlink`]})]},e.uid??e.key))}):n.test?(0,X.jsxs)(`dl`,{className:`m-0 grid grid-cols-[120px_1fr] gap-x-4 gap-y-2 text-[13px]`,children:[(0,X.jsx)(`dt`,{className:`text-muted`,children:`Test`}),(0,X.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:n.test.name}),(0,X.jsx)(`dt`,{className:`text-muted`,children:`File`}),(0,X.jsx)(`dd`,{className:`m-0 font-mono [overflow-wrap:anywhere]`,children:n.test.file??`–`}),(0,X.jsx)(`dt`,{className:`text-muted`,children:`Known from`}),(0,X.jsx)(`dd`,{className:`m-0`,children:n.how===`none`?`–`:ve[n.how]})]}):(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`No automated test is linked. Link one, ask the agent, or ask the agent on the right to automate it.`}),(n.tests.length>0||n.test)&&(0,X.jsxs)(`p`,{className:`m-0 flex items-center gap-2 text-[13px] text-muted`,children:[`Last runs `,(0,X.jsx)(Ie,{runs:e.test?.runs??n.runs})]}),n.proposed.length>0&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[12px] bg-surface-muted p-4 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:`Proposed by the mapping agent`}),n.proposed.map(e=>{let t=u.get(e.test);return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col`,children:[(0,X.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:t?.name??e.test}),(0,X.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[(0,X.jsx)(`span`,{className:`font-mono`,children:e.test}),e.confidence?` · ${e.confidence} confidence`:``,e.why?` · ${e.why}`:``]})]}),(0,X.jsxs)(L,{size:`sm`,onClick:()=>void f(e.test,`accept`,`Linked ${e.test}.`),children:[(0,X.jsx)(T,{"aria-hidden":`true`}),`Accept`]}),(0,X.jsxs)(L,{size:`sm`,variant:`ghost`,onClick:()=>void f(e.test,`refuse`,`Refused ${e.test}.`),children:[(0,X.jsx)(s,{"aria-hidden":`true`}),`Refuse`]})]},e.test)})]}),(0,X.jsx)(Je,{open:a,title:`Link a test`,description:`Pick a test that checks ${n.id}. It is kept in .forgeqe/testmgmt/links.json, shared with the team.`,items:(r??[]).filter(e=>e.uid&&!n.tests.some(t=>t.uid===e.uid)).map(e=>({id:e.uid,label:e.name,sub:`${e.uid}${e.file?` · ${e.file}`:``}`})),onClose:()=>o(!1),onPick:async e=>{await J.link([{case:n.key,test:e,action:`link`}]),o(!1),t(`Linked ${e}.`)}})]})}var Qe=[{id:`all`,label:`All`,icon:w,test:()=>!0},{id:`not_automated`,label:`Not automated`,icon:o,test:e=>e.automation===`not_automated`},{id:`failing`,label:`Failing`,icon:l,test:Ve,alert:!0},{id:`pending`,label:`Pending`,icon:c,test:e=>e.automation===`pending`},{id:`generated`,label:`Generated by ForgeQE`,icon:v,test:e=>e.origin===`forgeqe`},{id:`stale`,label:`Steps changed`,icon:D,test:e=>e.stale},{id:`drift`,label:`Tracker disagrees`,icon:D,test:e=>e.drift}],$=``,$e=e=>[...new Set(e.filter(e=>!!e))].sort((e,t)=>e.localeCompare(t,void 0,{numeric:!0}));function et({cases:t,tests:n=0,selected:i,onSelect:a,onRun:o,onChanged:c}){let[l,u]=(0,q.useState)(`all`),[d,f]=(0,q.useState)($),[p,m]=(0,q.useState)($),[h,_]=(0,q.useState)($),[y,b]=(0,q.useState)($),[x,ee]=(0,q.useState)(!1),[te,S]=(0,q.useState)(!1),[C,w]=(0,q.useState)(null),T=(0,q.useMemo)(()=>$e(t.flatMap(e=>e.plans)),[t]),D=(0,q.useMemo)(()=>$e(t.map(e=>e.suite)),[t]),ne=(0,q.useMemo)(()=>$e(t.flatMap(e=>e.tags)),[t]),re=t.filter(e=>(!d||e.plans.includes(d))&&(!p||e.suite===p)&&(!h||String(e.priority??``)===h)&&(!y||e.tags.includes(y))),ie=Qe.find(e=>e.id===l),k=re.filter(ie.test),A=new Set(i),ae=(e,t)=>a(t?[...i,e]:i.filter(t=>t!==e)),j=k.length>0&&k.every(e=>A.has(e.key));return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[i.length>0&&(0,X.jsxs)(`div`,{role:`status`,className:`flex flex-wrap items-center gap-2 rounded-[12px] bg-accent-soft px-4 py-2 text-[13px] text-accent-fg`,children:[(0,X.jsxs)(`span`,{className:`font-medium`,children:[i.length,` selected`]}),(0,X.jsxs)(L,{size:`sm`,variant:`ghost`,onClick:()=>a([]),children:[(0,X.jsx)(s,{"aria-hidden":`true`}),`Clear`]}),(0,X.jsx)(`span`,{className:`flex-1`}),(0,X.jsxs)(L,{size:`sm`,onClick:()=>ee(!0),children:[(0,X.jsx)(g,{"aria-hidden":`true`}),`Tag`]}),(0,X.jsxs)(L,{size:`sm`,onClick:()=>S(!0),children:[(0,X.jsx)(r,{"aria-hidden":`true`}),`Make a suite`]}),(0,X.jsxs)(L,{size:`sm`,onClick:()=>w(`automation`),"data-tip":`Mark the picked cases automated in their tracker`,children:[(0,X.jsx)(E,{"aria-hidden":`true`}),`Mark automated`]}),(0,X.jsxs)(L,{size:`sm`,onClick:()=>w(`tags`),"data-tip":`Write ForgeQE's tags to their tracker`,children:[(0,X.jsx)(E,{"aria-hidden":`true`}),`Write tags`]}),(0,X.jsxs)(L,{size:`sm`,variant:`primary`,onClick:()=>o(i),children:[(0,X.jsx)(e,{"aria-hidden":`true`}),`Run `,i.length]})]}),(0,X.jsx)(V,{label:`Test cases`,placeholder:`Find a case by id, title, tag or test`,resetKey:`${l}|${d}|${p}|${h}|${y}`,empty:t.length?`Nothing matches.`:n?`No test cases yet. The repository's ${n} automated test${n===1?` is`:`s are`} on the Automated tab.`:`No test cases yet.`,tools:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,X.jsx)(oe,{items:Qe.map(e=>({id:e.id,label:e.label,icon:e.icon,n:re.filter(e.test).length,...e.alert?{alert:!0}:{}})),value:l,onChange:u})}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[T.length>1&&(0,X.jsxs)(N,{size:`sm`,"aria-label":`Plan`,value:d,onChange:e=>f(e.target.value),className:`w-auto`,children:[(0,X.jsx)(`option`,{value:$,children:`Every plan`}),T.map(e=>(0,X.jsx)(`option`,{children:e},e))]}),D.length>0&&(0,X.jsxs)(N,{size:`sm`,"aria-label":`Suite`,value:p,onChange:e=>m(e.target.value),className:`w-auto`,children:[(0,X.jsx)(`option`,{value:$,children:`Every suite`}),D.map(e=>(0,X.jsx)(`option`,{children:e},e))]}),(0,X.jsxs)(N,{size:`sm`,"aria-label":`Priority`,value:h,onChange:e=>_(e.target.value),className:`w-auto`,children:[(0,X.jsx)(`option`,{value:$,children:`Any priority`}),[`1`,`2`,`3`,`4`].map(e=>(0,X.jsxs)(`option`,{value:e,children:[`Priority `,e]},e))]}),ne.length>0&&(0,X.jsxs)(N,{size:`sm`,"aria-label":`Tag`,value:y,onChange:e=>b(e.target.value),className:`w-auto`,children:[(0,X.jsx)(`option`,{value:$,children:`Any tag`}),ne.map(e=>(0,X.jsx)(`option`,{children:e},e))]})]})]}),head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:O(R,`w-10`),children:(0,X.jsx)(K,{"aria-label":`Select every case shown`,checked:j,onCheckedChange:e=>a(e?$e([...i,...k.map(e=>e.key)]):i.filter(e=>!k.some(t=>t.key===e)))})}),(0,X.jsx)(`th`,{className:R,children:`Test case`}),(0,X.jsx)(`th`,{className:O(R,`hidden @2xl:table-cell`),children:`Suite`}),(0,X.jsx)(`th`,{className:O(R,`hidden @2xl:table-cell`),children:`Priority`}),(0,X.jsx)(`th`,{className:R,children:`Automation`}),(0,X.jsx)(`th`,{className:O(R,`hidden @4xl:table-cell`),children:`Last runs`}),(0,X.jsx)(`th`,{className:R,children:`Last run`}),(0,X.jsx)(`th`,{className:R,children:(0,X.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:k.map(t=>(0,X.jsxs)(`tr`,{className:O(`border-t border-line-soft align-top hover:bg-surface-muted`,A.has(t.key)&&`bg-accent-soft hover:bg-accent-soft`),children:[(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(K,{"aria-label":`Select ${t.id}`,checked:A.has(t.key),onCheckedChange:e=>ae(t.key,e)})}),(0,X.jsx)(`td`,{className:H,children:(0,X.jsxs)(`a`,{href:He(t.key),className:`flex min-w-[220px] flex-col gap-1 text-ink no-underline`,children:[(0,X.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:t.title}),(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-muted`,children:[(0,X.jsx)(`span`,{className:`font-mono text-accent-fg`,children:t.id}),t.origin===`forgeqe`&&(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"data-tip":`ForgeQE wrote this case`,children:[(0,X.jsx)(v,{size:12,"aria-hidden":`true`}),`ForgeQE`]}),t.stories[0]&&(0,X.jsx)(`span`,{children:t.stories[0]}),(0,X.jsx)(Q,{tags:t.tags,max:2})]})]})}),(0,X.jsx)(`td`,{className:O(H,`hidden max-w-0 text-[13px] text-ink-2 @2xl:table-cell`),children:(0,X.jsx)(Z,{text:t.suite??t.plans[0]??`–`})}),(0,X.jsx)(`td`,{className:O(H,`hidden text-[13px] @2xl:table-cell`),children:t.priority?`P${t.priority}`:`–`}),(0,X.jsxs)(`td`,{className:H,children:[(0,X.jsx)(Pe,{a:t.automation}),t.stale&&(0,X.jsx)(`span`,{className:`mt-1 block text-[13px] text-warn`,children:`Steps changed`})]}),(0,X.jsx)(`td`,{className:O(H,`hidden @4xl:table-cell`),children:(0,X.jsx)(Ie,{runs:t.runs})}),(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(`span`,{"data-tip":t.lastRun.at?`${G(t.lastRun.at)}${t.lastRun.by===`tracker`?`, in its system`:``}`:void 0,children:(0,X.jsx)(Fe,{o:t.lastRun.outcome})})}),(0,X.jsx)(`td`,{className:O(H,`text-right whitespace-nowrap`),children:(0,X.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${t.id}`,"data-tip":Ve(t)?`Run again`:`Run`,onClick:()=>o([t.key]),children:(0,X.jsx)(e,{"aria-hidden":`true`})})})]},t.key))}),(0,X.jsx)(Ae,{kind:C,keys:i,onClose:()=>w(null),onDone:e=>c(e)}),(0,X.jsx)(tt,{open:x,keys:i,onClose:()=>ee(!1),onDone:e=>c(e)}),(0,X.jsx)(nt,{open:te,keys:i,onClose:()=>S(!1),onDone:e=>c(e)})]})}function tt({open:e,keys:t,onClose:n,onDone:r}){let[i,a]=(0,q.useState)(``),[o,c]=(0,q.useState)(!1),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(!1),p=async()=>{f(!0),u(``);try{let e={[o?`remove`:`add`]:[i.trim()],cases:t};await J.tag(e);let s=await J.tag(e,!0);r(`${o?`Removed`:`Added`} the tag ${i.trim()} ${o?`from`:`on`} ${s.changed??0} case${s.changed===1?``:`s`}.`),a(``),n()}catch(e){u(e.message)}finally{f(!1)}};return(0,X.jsx)(B,{open:e,onClose:n,title:`Tag ${t.length} test case${t.length===1?``:`s`}`,description:`ForgeQE keeps its tags in .forgeqe/testmgmt/tags.json, shared with the team through the repository. The case's own tags in its system do not change.`,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(L,{onClick:n,children:[(0,X.jsx)(s,{"aria-hidden":`true`}),`Cancel`]}),(0,X.jsxs)(L,{variant:`primary`,disabled:d||!i.trim(),onClick:()=>void p(),children:[(0,X.jsx)(g,{"aria-hidden":`true`}),o?`Remove`:`Add`,` tag`]})]}),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-[13px]`,children:[(0,X.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Tag`,(0,X.jsx)(k,{value:i,maxLength:40,placeholder:`smoke, release-24.11`,onChange:e=>a(e.target.value)})]}),(0,X.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(K,{checked:o,onCheckedChange:c}),`Remove it instead`]}),l&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:l})]})})}function nt({open:e,keys:t,onClose:n,onDone:i}){let[a,o]=(0,q.useState)(``),[c,l]=(0,q.useState)(``),[u,d]=(0,q.useState)(!1),f=async()=>{d(!0),l(``);try{let{suite:e}=await J.saveSuite({name:a.trim(),groups:[],exclude:[],picked:t});i(`Made the suite ${e.name}.`),o(``),n(),location.hash=F(`test-management`,`suites`,e.id)}catch(e){l(e.message)}finally{d(!1)}};return(0,X.jsx)(B,{open:e,onClose:n,title:`A suite of ${t.length} test case${t.length===1?``:`s`}`,description:`Kept in .forgeqe/testmgmt/suites.json. For a suite that keeps up as plans change, ask the Suite agent on Suites.`,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(L,{onClick:n,children:[(0,X.jsx)(s,{"aria-hidden":`true`}),`Cancel`]}),(0,X.jsxs)(L,{variant:`primary`,disabled:u||!a.trim(),onClick:()=>void f(),children:[(0,X.jsx)(r,{"aria-hidden":`true`}),`Make the suite`]})]}),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-[13px]`,children:[(0,X.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Name`,(0,X.jsx)(k,{value:a,maxLength:80,placeholder:`Saved cards`,onChange:e=>o(e.target.value)})]}),c&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:c})]})})}var rt=e=>new Date(`${e}T00:00:00Z`).toLocaleDateString([],{month:`short`,day:`numeric`,timeZone:`UTC`}),it=(e,t)=>t?Math.round(e/t*100):0;function at(e,t,n){if(e.length<2)return;let r=e.at(-1),i=new Date(`${r.day}T00:00:00Z`).getTime()-6048e5,a=[...e].reverse().find(e=>new Date(`${e.day}T00:00:00Z`).getTime()<=i)??e[0],o=t(r)-t(a);return{text:`${o>0?`+`:``}${o}`,dir:o>0?`up`:o<0?`down`:`same`,...n===void 0||o===0?{}:{good:o>0===n},against:`since ${rt(a.day)}`}}function ot({view:t,onRunSuite:n}){let r=t.summary;if(!r.cases&&!t.plans.length&&r.tests)return(0,X.jsx)(M,{icon:d,title:`${r.tests} automated test${r.tests===1?``:`s`} found, no test case yet`,action:(0,X.jsxs)(`a`,{className:ie({size:`sm`}),href:F(`test-management`,`tests`),"data-tip":`Open the Automated tab`,children:[(0,X.jsx)(S,{"aria-hidden":`true`}),`See the tests`]}),children:`These are the tests in the automation repository's code. Add a test plan in Settings › Integrations (Azure DevOps, Xray, TestRail, Zephyr Scale or qTest) to see the test cases they cover, which are automated and which are not.`});if(!r.cases&&!t.plans.length)return(0,X.jsx)(M,{icon:w,title:`No test plans connected yet`,action:(0,X.jsxs)(`a`,{className:ie({size:`sm`}),href:F(`settings`,`integrations`),"data-tip":`Open Settings, Integrations`,children:[(0,X.jsx)(S,{"aria-hidden":`true`}),`Settings`]}),children:`Add a test plan under Test plans in Test management, in your test case system's settings (Azure DevOps, Xray, TestRail, Zephyr Scale or qTest). Its cases show here with their automation, runs and gaps. Cases ForgeQE wrote or automated show here already.`});let i=t.trend;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,X.jsxs)(le,{label:`Headline numbers`,children:[(0,X.jsx)(W,{label:`Test cases`,icon:w,value:r.cases,change:at(i,e=>e.cases,void 0),note:`${t.plans.length} plan${t.plans.length===1?``:`s`}`}),(0,X.jsx)(W,{label:`Automated`,icon:a,value:`${r.automated} · ${it(r.automated,r.cases)}%`,change:at(i,e=>e.automated,!0),note:`${r.newlyAutomated} newly this week`}),(0,X.jsx)(W,{label:`Not automated`,icon:o,value:r.notAutomated,change:at(i,e=>e.notAutomated,!1)}),(0,X.jsx)(W,{label:`Pending`,icon:c,value:r.pending,tone:r.pending?`text-warn`:void 0,change:at(i,e=>e.pending,!1),note:`in Design or not ready`}),(0,X.jsx)(W,{label:`Failing`,icon:l,value:r.failing,tone:r.failing?`text-fail`:void 0,change:at(i,e=>e.failing,!1),note:`their last run`}),(0,X.jsx)(W,{label:`Generated by ForgeQE`,icon:v,value:r.generated,change:at(i,e=>e.generated,!0)})]}),(0,X.jsxs)(`div`,{className:`grid gap-6 @3xl:grid-cols-2`,children:[(0,X.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,X.jsx)(`h2`,{className:`m-0 text-[16px] font-semibold`,children:`Automation coverage`}),(0,X.jsx)(Le,{label:`Share of test cases automated`,points:i.map(e=>({x:rt(e.day),y:it(e.automated,e.cases)})),format:e=>`${e}%`})]}),(0,X.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,X.jsx)(`h2`,{className:`m-0 text-[16px] font-semibold`,children:`Generated and automated, by week`}),(0,X.jsx)(Re,{label:`Test cases generated and automated each week`,series:[{name:`Generated`,className:`bg-accent-line`},{name:`Automated`,className:`bg-accent`}],items:t.weekly.map(e=>({x:rt(e.week),values:[e.generated,e.automated]}))})]}),(0,X.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,X.jsx)(`h2`,{className:`m-0 text-[16px] font-semibold`,children:`Last run of every case`}),(0,X.jsxs)(`div`,{role:`img`,"aria-label":`Passed ${r.cases-r.failing-r.neverRun}, failing ${r.failing}, not run ${r.neverRun}`,className:`flex h-3 gap-1 overflow-hidden rounded-full`,children:[(0,X.jsx)(`span`,{className:`bg-pass`,style:{flex:r.cases-r.failing-r.neverRun}}),(0,X.jsx)(`span`,{className:`bg-fail`,style:{flex:r.failing}}),(0,X.jsx)(`span`,{className:`bg-line-strong`,style:{flex:r.neverRun}})]}),(0,X.jsxs)(`span`,{className:`flex flex-wrap gap-4 text-[13px]`,children:[(0,X.jsx)(`a`,{href:F(`test-management`,`cases`),className:`no-underline`,children:(0,X.jsxs)(A,{tone:`pass`,children:[`Passed `,r.cases-r.failing-r.neverRun]})}),(0,X.jsx)(`a`,{href:F(`test-management`,`gaps`),className:`no-underline`,children:(0,X.jsxs)(A,{tone:`fail`,children:[`Failing `,r.failing]})}),(0,X.jsx)(`a`,{href:F(`test-management`,`gaps`),className:`no-underline`,children:(0,X.jsxs)(A,{tone:`neutral`,children:[`Not run `,r.neverRun]})})]})]}),(0,X.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,X.jsxs)(`span`,{className:`flex items-baseline justify-between gap-4`,children:[(0,X.jsx)(`h2`,{className:`m-0 text-[16px] font-semibold`,children:`Automated, by suite`}),(0,X.jsx)(`a`,{href:F(`test-management`,`gaps`),className:`text-[13px]`,children:`Find gaps`})]}),t.coverage.length?t.coverage.slice(0,8).map(e=>(0,X.jsx)(ze,{label:e.suite,part:e.automated,whole:e.cases},e.suite)):(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`No suites yet.`})]})]}),(0,X.jsx)(V,{label:`Suites`,placeholder:`Find a suite`,empty:`No suites yet: ask the Suite agent for one on Suites.`,search:t.suites.length>8,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:R,children:`Suite`}),(0,X.jsx)(`th`,{className:U,children:`Cases`}),(0,X.jsx)(`th`,{className:R,children:`Last run`}),(0,X.jsx)(`th`,{className:R,children:(0,X.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:t.suites.map(t=>(0,X.jsxs)(`tr`,{className:de,onClick:()=>location.hash=F(`test-management`,`suites`,t.id),children:[(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(`a`,{href:F(`test-management`,`suites`,t.id),onClick:e=>e.stopPropagation(),className:`font-medium`,children:t.name})}),(0,X.jsx)(`td`,{className:z,children:t.cases}),(0,X.jsx)(`td`,{className:H,children:t.last?(0,X.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2 text-[13px]`,children:[(0,X.jsxs)(A,{tone:t.last.failed?`fail`:`pass`,children:[t.last.passed,` passed`,t.last.failed?`, ${t.last.failed} failed`:``]}),(0,X.jsx)(`span`,{className:`text-muted`,children:G(t.last.at)})]}):(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Not run`})}),(0,X.jsxs)(`td`,{className:`${H} text-right whitespace-nowrap`,onClick:e=>e.stopPropagation(),children:[!!t.last?.failed&&(0,X.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Rerun the failed cases of ${t.name}`,"data-tip":`Rerun failed`,onClick:()=>n(t.id,`failed`),children:(0,X.jsx)(u,{"aria-hidden":`true`})}),(0,X.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${t.name}`,"data-tip":`Run`,onClick:()=>n(t.id),children:(0,X.jsx)(e,{"aria-hidden":`true`})})]})]},t.id))}),(0,X.jsxs)(`p`,{className:`m-0 flex items-center gap-2 text-[13px] text-muted`,children:[(0,X.jsx)(d,{size:14,"aria-hidden":`true`}),r.tests,` automated tests known, `,r.testsWithoutCase,` with no test case behind them.`]})]})}var st=e=>e&&/^https:\/\//i.test(e)?e:void 0;function ct({id:e,title:t,url:n}){let r=st(n);return(0,X.jsxs)(`span`,{className:`flex min-w-[220px] flex-col gap-1`,children:[(0,X.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:t}),r?(0,X.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,className:`font-mono text-[13px] text-accent-fg`,children:e}):(0,X.jsx)(`span`,{className:`font-mono text-[13px] text-accent-fg`,children:e})]})}var lt={azure_devops:[{key:`sprint`,label:`Sprint`,placeholder:`current, or Sprint 24`},{key:`iteration`,label:`Iteration path`,placeholder:`Shop\\Release 3`},{key:`area`,label:`Area path`,placeholder:`Shop\\Checkout`},{key:`parent`,label:`Epic or feature`,placeholder:`1234`,number:!0},{key:`ids`,label:`Work item ids`,placeholder:`101, 102`,list:`numbers`},{key:`project`,label:`Project`,placeholder:`When Settings names none`}],jira:[{key:`sprint`,label:`Sprint`,placeholder:`current, or Sprint 24`},{key:`fixVersion`,label:`Fix version`,placeholder:`2.4.0`},{key:`epic`,label:`Epic`,placeholder:`SHOP-12`},{key:`keys`,label:`Story keys`,placeholder:`SHOP-101, SHOP-102`,list:`keys`},{key:`project`,label:`Project key`,placeholder:`SHOP`}],qtest:[{key:`module`,label:`Requirements module`,placeholder:`Module id, e.g. 1203`,number:!0},{key:`ids`,label:`Requirement ids`,placeholder:`5101, 5102`,list:`numbers`}]};function ut(e,t){let n={system:e};for(let r of lt[e]){let i=(t[r.key]??``).trim();i&&(r.list===`numbers`?n[r.key]=i.split(/[\s,]+/).filter(Boolean).map(Number):r.list===`keys`?n[r.key]=i.split(/[\s,]+/).filter(Boolean).map(e=>e.toUpperCase()):r.number?n[r.key]=Number(i):n[r.key]=r.key===`project`&&e===`jira`?i.toUpperCase():i)}return n}var dt=e=>Object.fromEntries(Object.entries(e??{}).filter(([e])=>e!==`system`).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]));function ft({gaps:e,onRead:n}){let[r,i]=(0,q.useState)(e.live?.system??`azure_devops`),[a,o]=(0,q.useState)(dt(e.live)),[s,c]=(0,q.useState)(!1),[l,u]=(0,q.useState)(``);(0,q.useEffect)(()=>{e.live&&(i(e.live.system),o(dt(e.live)))},[e.live]);let d=async()=>{c(!0),u(``);try{await J.readStories(ut(r,a)),n()}catch(e){u(e.message)}finally{c(!1)}};return(0,X.jsxs)(`form`,{className:`card flex flex-col gap-4 rounded-[14px] border p-4`,onSubmit:e=>{e.preventDefault(),d()},children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,X.jsxs)(`label`,{className:`flex flex-col gap-1 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`text-muted`,children:`Stories in`}),(0,X.jsxs)(N,{size:`sm`,value:r,onChange:e=>(i(e.target.value),o({})),className:`w-auto`,children:[(0,X.jsx)(`option`,{value:`azure_devops`,children:`Azure DevOps`}),(0,X.jsx)(`option`,{value:`jira`,children:`Jira (also Xray and Zephyr Scale)`}),(0,X.jsx)(`option`,{value:`qtest`,children:`qTest requirements`})]})]}),lt[r].map(e=>(0,X.jsxs)(`label`,{className:`flex min-w-[140px] flex-[1_1_140px] flex-col gap-1 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`text-muted`,children:e.label}),(0,X.jsx)(k,{size:`sm`,value:a[e.key]??``,maxLength:e.list?2e3:200,placeholder:e.placeholder,onChange:t=>o({...a,[e.key]:t.target.value})})]},e.key)),(0,X.jsxs)(L,{size:`sm`,variant:`primary`,type:`submit`,disabled:s||!lt[r].some(e=>e.key!==`project`&&(a[e.key]??``).trim()),children:[(0,X.jsx)(t,{"aria-hidden":`true`}),s?`Reading…`:`Read stories`]})]}),l&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:l})]})}function pt({kind:e,gaps:t,picked:n=[],onPick:r=()=>{},onRead:i=()=>{}}){let a=(0,X.jsx)(ft,{gaps:t,onRead:i});if(!t.report)return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[a,(0,X.jsx)(M,{icon:ee,title:`No stories read yet`,children:`Say which stories to read: a sprint, an iteration, an area, an epic or the ids. ForgeQE reads each story with its test cases and acceptance criteria from the tracker, as Release readiness does, and reads them again with every sync.`})]});let o=(0,X.jsxs)(`p`,{className:`m-0 text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:[t.report.id===`live`?`Read from the tracker${t.report.at?` ${G(t.report.at)}`:``}: ${t.report.scope}`:`From the readiness report of ${t.report.scope||t.report.id}`,` (`,t.stories,` stor`,t.stories===1?`y`:`ies`,`).`,e===`stories`&&n.length>0&&` ${n.length} picked for the Gap agent's "Cases for stories".`]}),s=new Set(t.noCase.map(e=>e.id)),c=new Set(n.filter(e=>s.has(e)));return e===`stories`?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a,o,(0,X.jsx)(V,{label:`Stories with no test case`,placeholder:`Find a story`,empty:`Every story of the release has a test case.`,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:O(R,`w-10`),children:(0,X.jsx)(K,{"aria-label":`Pick every story shown`,checked:t.noCase.length>0&&t.noCase.every(e=>c.has(e.id)),onCheckedChange:e=>r(e?t.noCase.map(e=>e.id).slice(0,50):[])})}),(0,X.jsx)(`th`,{className:O(R,`w-[55%]`),children:`Story`}),(0,X.jsx)(`th`,{className:O(R,`hidden @2xl:table-cell`),children:`Type`}),(0,X.jsx)(`th`,{className:R,children:`State`}),(0,X.jsx)(`th`,{className:O(R,`hidden @2xl:table-cell`),children:`Area`})]}),children:t.noCase.map(e=>(0,X.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(K,{"aria-label":`Pick ${e.id}`,checked:c.has(e.id),onCheckedChange:t=>r(t?[...c,e.id].slice(0,50):[...c].filter(t=>t!==e.id))})}),(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(ct,{id:e.id,title:e.title,url:e.url})}),(0,X.jsx)(`td`,{className:O(H,`hidden text-[13px] @2xl:table-cell`),children:e.type||`–`}),(0,X.jsx)(`td`,{className:H,children:e.state?(0,X.jsx)(A,{tone:`neutral`,icon:!1,children:e.state}):(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:`–`})}),(0,X.jsx)(`td`,{className:O(H,`hidden text-[13px] @2xl:table-cell [overflow-wrap:anywhere]`),children:e.area||`–`})]},e.id))})]}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a,o,(0,X.jsx)(V,{label:`Acceptance criteria no test case covers`,placeholder:`Find a criterion`,empty:`Every traced acceptance criterion has a test case.`,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:O(R,`w-[55%]`),children:`Criterion`}),(0,X.jsx)(`th`,{className:R,children:`Story`})]}),children:t.criteria.map((e,t)=>(0,X.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,X.jsx)(`td`,{className:O(H,`[overflow-wrap:anywhere]`),children:e.text}),(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(ct,{id:e.story,title:e.storyTitle,url:e.url})})]},`${e.story}-${t}`))})]})}var mt=[{id:`stories`,label:`Stories with no case`,icon:ee},{id:`criteria`,label:`Criteria not covered`,icon:w}],ht=[{id:`not_automated`,label:`Not automated`,icon:o},{id:`pending`,label:`Pending`,icon:c},{id:`never_run`,label:`Never run`,icon:o},{id:`failing`,label:`Failing`,icon:l,alert:!0},{id:`stale`,label:`Steps changed`,icon:D},{id:`drift`,label:`Tracker disagrees`,icon:D},{id:`no_case`,label:`Tests with no case`,icon:d}];function gt({gaps:t,cases:n,tests:r,selected:i,onSelect:a,onRun:o,pickedStories:s=[],onPickStories:c=()=>{},onStoriesRead:l=()=>{}}){let[u,d]=(0,q.useState)(n.length||!r.length?`not_automated`:`no_case`),f=new Map(n.map(e=>[e.key,e])),p=new Map(t.ranked.map(e=>[e.key,e.why])),m=u===`no_case`||u===`stories`||u===`criteria`?[]:u===`not_automated`?t.ranked.map(e=>e.key):t.lists[u],h=t.stories??{stories:0,noCase:[],criteria:[]},g={stories:h.noCase.length,criteria:h.criteria.length},_=m.map(e=>f.get(e)).filter(e=>!!e),v=new Set(i),y=(e,t)=>a(t?[...i,e]:i.filter(t=>t!==e));return(0,X.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,X.jsxs)(`div`,{className:`grid gap-6 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,X.jsx)(oe,{items:[...ht.map(e=>({id:e.id,label:e.label,icon:e.icon,n:t.counts[e.id],...e.alert?{alert:!0}:{}})),...mt.map(e=>({id:e.id,label:e.label,icon:e.icon,n:g[e.id],tip:h.report?h.report.id===`live`?`Read from the tracker: ${h.report.scope}`:`From the readiness report of ${h.report.scope||h.report.id}`:`Read the release's stories from the tracker first`}))],value:u,onChange:e=>d(e)})}),u===`not_automated`&&_.length>0&&(0,X.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-[13px] text-ink-2`,children:[`Highest value first: priority, failing when run, in a pack, tagged smoke.`,(0,X.jsx)(L,{size:`sm`,onClick:()=>a(_.slice(0,20).map(e=>e.key)),children:`Pick the top 20`})]})]}),(0,X.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,X.jsx)(`h2`,{className:`m-0 text-[16px] font-semibold`,children:`Not automated, by suite`}),t.bySuite.length?t.bySuite.slice(0,8).map(e=>(0,X.jsx)(ze,{label:e.suite,part:e.notAutomated+e.pending,whole:e.cases,className:`bg-warn`},e.suite)):(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Nothing left to automate.`})]})]}),u===`stories`||u===`criteria`?(0,X.jsx)(pt,{kind:u,gaps:h,picked:s,onPick:c,onRead:l}):u===`no_case`?(0,X.jsx)(V,{label:`Tests with no test case`,placeholder:`Find a test`,empty:`Every test ForgeQE knows has a test case behind it.`,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:O(R,`w-[55%]`),children:`Test`}),(0,X.jsx)(`th`,{className:R,children:`Tags`}),(0,X.jsx)(`th`,{className:R,children:`Last runs`})]}),children:t.testsWithoutCase.map(e=>{let t=r.find(t=>t.key===e);return t?(0,X.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,X.jsxs)(`td`,{className:O(H,`max-w-0`),children:[(0,X.jsx)(Z,{text:t.name,tip:t.file?`${t.name} · ${t.file}`:t.name}),t.flaky&&(0,X.jsx)(A,{tone:`warn`,className:`mt-1`,children:`Flaky`})]}),(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(Q,{tags:t.tags})}),(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(Ie,{runs:t.runs})})]},e):null})}):(0,X.jsx)(V,{label:ht.find(e=>e.id===u).label,placeholder:`Find a case`,resetKey:u,empty:`No gap of this kind.`,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:O(R,`w-10`),children:(0,X.jsx)(K,{"aria-label":`Select every case shown`,checked:_.length>0&&_.every(e=>v.has(e.key)),onCheckedChange:e=>a(e?[...new Set([...i,..._.map(e=>e.key)])]:i.filter(e=>!_.some(t=>t.key===e)))})}),(0,X.jsx)(`th`,{className:R,children:`Test case`}),(0,X.jsx)(`th`,{className:O(R,`hidden @2xl:table-cell`),children:`Priority`}),(0,X.jsx)(`th`,{className:R,children:u===`not_automated`?`Why it matters`:`Automation`}),(0,X.jsx)(`th`,{className:O(R,`hidden @2xl:table-cell`),children:`Last run`}),(0,X.jsx)(`th`,{className:R,children:(0,X.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:_.map(t=>(0,X.jsxs)(`tr`,{className:O(`border-t border-line-soft align-top hover:bg-surface-muted`,v.has(t.key)&&`bg-accent-soft hover:bg-accent-soft`),children:[(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(K,{"aria-label":`Select ${t.id}`,checked:v.has(t.key),onCheckedChange:e=>y(t.key,e)})}),(0,X.jsx)(`td`,{className:H,children:(0,X.jsxs)(`a`,{href:He(t.key),className:`flex min-w-[220px] flex-col gap-1 text-ink no-underline`,children:[(0,X.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:t.title}),(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-muted`,children:[(0,X.jsx)(`span`,{className:`font-mono text-accent-fg`,children:t.id}),t.suite&&(0,X.jsx)(`span`,{children:t.suite}),(0,X.jsx)(Q,{tags:t.tags,max:2})]})]})}),(0,X.jsx)(`td`,{className:O(H,`hidden text-[13px] @2xl:table-cell`),children:t.priority?`P${t.priority}`:`–`}),(0,X.jsx)(`td`,{className:H,children:u===`not_automated`?(0,X.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[(p.get(t.key)??[]).map(e=>(0,X.jsx)(A,{tone:`running`,icon:!1,children:e},e)),!(p.get(t.key)??[]).length&&(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:`–`})]}):(0,X.jsx)(Pe,{a:t.automation})}),(0,X.jsx)(`td`,{className:O(H,`hidden @2xl:table-cell`),children:(0,X.jsx)(Fe,{o:t.lastRun.outcome})}),(0,X.jsx)(`td`,{className:O(H,`text-right`),children:(0,X.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${t.id}`,"data-tip":`Run`,onClick:()=>o([t.key]),children:(0,X.jsx)(e,{"aria-hidden":`true`})})})]},t.key))})]})}var _t=e=>e.from===`report`?`From the run's own report`:`From each case's latest result since the run started (its report is not written yet)`,vt={system:`system`,plan:`plan`,suite:`suite`,priority:`priority`,state:`state`,automation:`automation`,tag:`tag`,last_run:`last run`,origin:`origin`,stale:`steps changed`,in_pack:`in pack`};function yt({suites:t,onRun:n}){return t.length?(0,X.jsx)(V,{label:`Suites`,placeholder:`Find a suite`,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:O(R,`w-[40%]`),children:`Suite`}),(0,X.jsx)(`th`,{className:U,children:`Cases`}),(0,X.jsx)(`th`,{className:O(U,`hidden @xl:table-cell`),children:`Automated`}),(0,X.jsx)(`th`,{className:R,children:`Last run`}),(0,X.jsx)(`th`,{className:R,children:(0,X.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:t.map(t=>(0,X.jsxs)(`tr`,{className:de,onClick:()=>location.hash=F(`test-management`,`suites`,t.id),children:[(0,X.jsxs)(`td`,{className:O(H,`max-w-0`),children:[(0,X.jsxs)(`a`,{href:F(`test-management`,`suites`,t.id),onClick:e=>e.stopPropagation(),className:`flex items-center gap-2 font-medium`,children:[t.built===`agent`?(0,X.jsx)(v,{size:14,"aria-hidden":`true`,className:`flex-none`}):(0,X.jsx)(r,{size:14,"aria-hidden":`true`,className:`flex-none`}),(0,X.jsx)(Z,{text:t.name})]}),t.description&&(0,X.jsx)(Z,{text:t.description,className:`mt-1 text-[13px] text-muted`})]}),(0,X.jsx)(`td`,{className:z,children:t.cases}),(0,X.jsxs)(`td`,{className:O(z,`hidden @xl:table-cell`),children:[t.cases?Math.round(t.automated/t.cases*100):0,`%`]}),(0,X.jsx)(`td`,{className:H,children:t.last?(0,X.jsxs)(`span`,{className:`flex flex-col items-start gap-1 text-[13px]`,"data-tip":_t(t.last),children:[(0,X.jsxs)(A,{tone:t.last.failed?`fail`:`pass`,children:[t.last.passed,` passed`,t.last.failed?`, ${t.last.failed} failed`:``]}),(0,X.jsx)(`span`,{className:`text-muted`,children:G(t.last.at)})]}):(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Not run`})}),(0,X.jsxs)(`td`,{className:O(H,`text-right whitespace-nowrap`),onClick:e=>e.stopPropagation(),children:[!!t.last?.failed&&(0,X.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Rerun the failed cases of ${t.name}`,"data-tip":`Rerun failed`,onClick:()=>n(t.id,`failed`),children:(0,X.jsx)(u,{"aria-hidden":`true`})}),(0,X.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${t.name}`,"data-tip":`Run`,onClick:()=>n(t.id),children:(0,X.jsx)(e,{"aria-hidden":`true`})})]})]},t.id))}):(0,X.jsx)(M,{icon:r,title:`No suites yet`,children:`Tell the Suite agent on the right what the suite is for, such as “regression for the payments suite, P1 and anything failing lately”. It picks the cases from your plans, tags and runs.`})}function bt({id:t,onRun:n,onDeleted:r}){let[i,a]=(0,q.useState)(null),[o,c]=(0,q.useState)(``),[l,d]=(0,q.useState)(!1),[f,m]=(0,q.useState)(!1);(0,q.useEffect)(()=>{a(null),J.suite(t).then(e=>{a(e),c(``)},e=>c(e.message))},[t]);let h=(0,X.jsxs)(`a`,{href:F(`test-management`,`suites`),className:`inline-flex w-fit items-center gap-2 text-[13px]`,children:[(0,X.jsx)(p,{size:14,"aria-hidden":`true`}),`All suites`]});if(o)return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[h,(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail`,children:o})]});if(!i)return(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`});let g=i.suite,_=i.members.filter(e=>e.case.lastRun.outcome===`failed`||e.case.lastRun.outcome===`blocked`).length;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[h,(0,X.jsxs)(`header`,{className:`flex flex-wrap items-start gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1`,children:[(0,X.jsx)(`h2`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:g.name}),g.description&&(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:g.description}),g.tracker&&(0,X.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[`Kept as`,` `,Ee(g.tracker)?(0,X.jsx)(`a`,{href:Ee(g.tracker),target:`_blank`,rel:`noreferrer noopener`,children:De(g.tracker)}):De(g.tracker)]})]}),(0,X.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[(g.tracker||i.targets.length>0)&&(0,X.jsxs)(L,{onClick:()=>m(!0),children:[(0,X.jsx)(E,{"aria-hidden":`true`}),g.tracker?`Keep in step`:`Keep in tracker`]}),(0,X.jsxs)(L,{variant:`danger`,onClick:()=>d(!0),children:[(0,X.jsx)(y,{"aria-hidden":`true`}),`Delete`]}),_>0&&(0,X.jsxs)(L,{onClick:()=>n(g.id,`failed`),children:[(0,X.jsx)(u,{"aria-hidden":`true`}),`Rerun `,_,` failed`]}),(0,X.jsxs)(L,{variant:`primary`,onClick:()=>n(g.id),children:[(0,X.jsx)(e,{"aria-hidden":`true`}),`Run suite`]})]})]}),(0,X.jsxs)(le,{label:`The suite`,children:[(0,X.jsx)(W,{compact:!0,label:`Cases`,value:g.cases,note:`${g.automated} automated`}),(0,X.jsx)(W,{compact:!0,label:`Last run`,value:g.last?`${g.last.passed} passed`:`Not run`,tone:g.last?.failed?`text-fail`:void 0,note:g.last?`${g.last.failed} failed · ${G(g.last.at)}${g.last.from===`report`?``:` · so far`}`:void 0}),(0,X.jsx)(W,{compact:!0,label:`Runs on`,value:g.env??`Active`,note:g.runs.length?`${g.runs.length} run${g.runs.length===1?``:`s`}`:`never run`}),(0,X.jsx)(W,{compact:!0,label:`Built`,value:g.built===`agent`?`Suite agent`:g.built===`rules`?`Rules`:`Picked`,note:`updated ${G(g.updatedAt)}`})]}),g.groupsCount.length>0&&(0,X.jsxs)(`section`,{className:`card flex flex-col gap-2 rounded-[14px] border p-6 text-[13px]`,children:[(0,X.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold`,children:`Why these cases`}),(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:g.groupsCount.map((e,t)=>(0,X.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,X.jsx)(`span`,{className:`text-muted`,children:g.groups[t]?.rules.map(e=>`${vt[e.field]} ${e.op===`is`?`is`:`is not`} ${e.value}`).join(` and `)}),(0,X.jsx)(`span`,{className:`ml-auto tabular-nums`,children:e.cases})]},e.label))})]}),(0,X.jsx)(V,{label:`Cases`,placeholder:`Find a case`,empty:`No case meets the suite's rules now.`,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:O(R,`w-[45%]`),children:`Test case`}),(0,X.jsx)(`th`,{className:O(R,`hidden @xl:table-cell`),children:`Why it is in`}),(0,X.jsx)(`th`,{className:R,children:`Automation`}),(0,X.jsx)(`th`,{className:R,children:`Last run`})]}),children:i.members.map(e=>(0,X.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,X.jsx)(`td`,{className:O(H,`max-w-0`),children:(0,X.jsxs)(`a`,{href:He(e.case.key),className:`flex min-w-0 flex-col gap-1 text-ink no-underline`,children:[(0,X.jsx)(Z,{text:e.case.title,className:`font-medium`}),(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-muted`,children:[(0,X.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.case.id}),(0,X.jsx)(Q,{tags:e.case.tags})]})]})}),(0,X.jsx)(`td`,{className:O(H,`hidden text-[13px] text-ink-2 @xl:table-cell`),children:e.group}),(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(Pe,{a:e.case.automation})}),(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(Fe,{o:e.case.lastRun.outcome})})]},e.case.key))}),(0,X.jsx)(je,{open:f,suite:g,targets:i.targets,onClose:()=>m(!1),onDone:()=>void J.suite(t).then(a,()=>{})}),(0,X.jsx)(B,{open:l,onClose:()=>d(!1),title:`Delete ${g.name}?`,description:`The suite goes from .forgeqe/testmgmt/suites.json. Its cases and their runs stay.`,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(L,{onClick:()=>d(!1),children:[(0,X.jsx)(s,{"aria-hidden":`true`}),`Cancel`]}),(0,X.jsxs)(L,{variant:`destructive`,onClick:()=>void J.deleteSuite(g.id).then(()=>{d(!1),r()},e=>c(e.message)),children:[(0,X.jsx)(y,{"aria-hidden":`true`}),`Delete`]})]}),children:(0,X.jsx)(`p`,{className:`m-0 pt-4 text-[13px] text-ink-2`,children:`Runs already made are kept in Runs.`})})]})}function xt({open:e,onSaved:t}){let[n,r]=(0,q.useState)([]),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(!1),[l,u]=(0,q.useState)(``),d=[...n].reverse().find(e=>`built`in e)?.built,f=n.filter(e=>`you`in e).map(e=>e.you).join(`. `),p=async t=>{let n=t.trim();if(n){c(!0),u(``),r(e=>[...e,{you:n}]),o(``);try{let t=await J.buildSuite(f?`${f}. ${n}`:n,e?.id);r(e=>[...e,{built:t}])}catch(e){u(e.message)}finally{c(!1)}}},m=async n=>{if(d){c(!0);try{let{suite:i}=await J.saveSuite({...n&&e?{id:e.id}:{},name:n&&e?e.name:d.name,description:d.summary,groups:d.groups,exclude:d.exclude,built:`agent`});r([]),t(i)}catch(e){u(e.message)}finally{c(!1)}}};return(0,X.jsxs)(be,{title:`Suite agent`,about:`Builds and changes suites from your plans, tags and runs.`,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(e?[`Leave out cases that are not automated`,`Add everything failing lately`,`Only priority 1 and 2`]:[`Smoke suite`,`P1 cases that failed lately`,`Everything not automated in one suite`]).map(e=>(0,X.jsx)(L,{size:`sm`,disabled:s,onClick:()=>void p(e),children:e},e))}),(0,X.jsxs)(`form`,{className:`flex items-end gap-2`,onSubmit:e=>{e.preventDefault(),p(a)},children:[(0,X.jsx)(`label`,{className:`sr-only`,htmlFor:`tm-suite-words`,children:`Tell the Suite agent what the suite is for`}),(0,X.jsx)(`textarea`,{id:`tm-suite-words`,rows:2,maxLength:1e3,value:a,placeholder:e?`Change ${e.name}, or ask about it`:`Describe the suite you need, e.g. regression for Payments under 30 minutes`,onChange:e=>o(e.target.value),className:`min-h-11 flex-1 resize-none rounded-[10px] border border-line bg-bg px-4 py-2 text-[13px] text-ink outline-none focus:border-accent`}),(0,X.jsx)(L,{size:`icon`,variant:`primary`,type:`submit`,disabled:s||!a.trim(),"aria-label":`Send`,"data-tip":`Send`,children:(0,X.jsx)(i,{"aria-hidden":`true`})})]})]}),children:[(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,X.jsx)(j,{state:s?`thinking`:`working`,px:96,label:s?`Building the suite`:`Ready`}),(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:s?`Building the suite…`:e?`Looking at ${e.name}.`:`Ready. Say what the suite is for.`})]}),n.map((e,t)=>`you`in e?(0,X.jsx)(`p`,{className:`m-0 text-center text-[16px] leading-relaxed text-ink-2`,children:e.you},t):(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`p`,{className:`m-0 text-center text-[20px] leading-snug`,children:[e.built.name,`: `,e.built.cases,` case`,e.built.cases===1?``:`s`,`, `,e.built.automated,` automated.`]}),e.built.summary&&(0,X.jsx)(`p`,{className:`m-0 text-center text-[13px] text-ink-2`,children:e.built.summary}),e.built.note&&(0,X.jsx)(`p`,{className:`m-0 text-center text-[13px] text-muted`,children:e.built.note}),(0,X.jsxs)(`div`,{className:`card flex flex-col gap-2 rounded-[14px] border bg-bg p-4 text-[13px]`,children:[e.built.perGroup.map(e=>(0,X.jsxs)(`span`,{className:`flex items-baseline gap-2`,"data-tip":e.why,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,X.jsx)(`span`,{className:`ml-auto tabular-nums`,children:e.cases})]},e.label)),e.built.exclude.length>0&&(0,X.jsxs)(`span`,{className:`text-muted`,children:[`Leaves out: `,e.built.exclude.map(e=>`${vt[e.field]} ${e.op===`is`?`is`:`is not`} ${e.value}`).join(`, `)]})]}),e.built.question&&t===n.length-1&&(0,X.jsxs)(`div`,{className:`card flex flex-col gap-2 rounded-[14px] border bg-bg p-4 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:e.built.question.text}),e.built.question.options.map(e=>(0,X.jsx)(L,{size:`sm`,disabled:s,onClick:()=>void p(e),className:`justify-start`,children:e},e))]}),e.built.sample.length>0&&(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:e.built.sample.slice(0,5).map(e=>(0,X.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`flex-none font-mono text-accent-fg`,children:e.case.id}),(0,X.jsx)(Z,{text:e.case.title,className:`min-w-0 text-ink-2`})]},e.case.key))})]},t)),l&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:l}),d&&(0,X.jsxs)(`span`,{className:`flex flex-wrap justify-center gap-2`,children:[e&&(0,X.jsxs)(L,{disabled:s,onClick:()=>void m(!0),children:[(0,X.jsx)(T,{"aria-hidden":`true`}),`Update `,e.name]}),(0,X.jsxs)(L,{variant:`primary`,disabled:s,onClick:()=>void m(!1),children:[(0,X.jsx)(T,{"aria-hidden":`true`}),`Save `,e?`as a new suite`:`suite`]})]})]})}var St=[{id:`off`,label:`Off`,icon:o},{id:`hourly`,label:`Every hour`,icon:t},{id:`daily`,label:`Daily`,icon:h}];function Ct(e){return!e||e.every===`off`?`Sync: off`:e.every===`hourly`?`Sync: hourly`:e.every===`daily`?`Sync: daily ${e.at}`:`Sync: custom`}function wt({disabled:e}){let[t,n]=(0,q.useState)(!1),[r,i]=(0,q.useState)(null);return(0,q.useEffect)(()=>{J.schedule().then(e=>i(e.schedule),()=>{})},[]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(L,{size:`sm`,disabled:e,onClick:()=>n(!0),"data-tip":r?.nextAt?`Next sync ${he(r.nextAt)}`:`Set when the plans are synced`,children:[(0,X.jsx)(h,{"aria-hidden":`true`}),Ct(r)]}),(0,X.jsx)(Tt,{open:t,onClose:()=>n(!1),now:r,onSaved:i})]})}function Tt({open:e,onClose:t,now:n,onSaved:r}){let[i,a]=(0,q.useState)(`off`),[o,c]=(0,q.useState)(`06:00`),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(!1),[p,m]=(0,q.useState)(null),[h,g]=(0,q.useState)(!1);(0,q.useEffect)(()=>{e&&(u(``),g(!!n&&n.every!==`off`&&n.every!==`custom`&&!!n.discover),J.discoveryPlan().then(m,()=>m(null)),a(n&&n.every!==`custom`?n.every:`off`),n?.every===`daily`&&c(n.at))},[e,n]);let _=async()=>{f(!0);try{let e=h&&p&&i!==`off`?{discover:p.digest}:{};r((await J.setSchedule(i===`daily`?{every:i,at:o,...e}:i===`hourly`?{every:i,...e}:{every:i})).schedule),t()}catch(e){u(e.message)}finally{f(!1)}};return(0,X.jsx)(B,{open:e,onClose:t,title:`Sync on a schedule`,description:`ForgeQE reads every case of the connected test plans again, as Sync does, and the stories Gaps read, in the jobs service (forgeqe testmgmt sync). It can also discover the tests first. It runs while this computer is on.`,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(L,{onClick:t,children:[(0,X.jsx)(s,{"aria-hidden":`true`}),`Cancel`]}),(0,X.jsxs)(L,{variant:`primary`,disabled:d||i===`daily`&&!/^([01]\d|2[0-3]):[0-5]\d$/.test(o),onClick:()=>void _(),children:[(0,X.jsx)(T,{"aria-hidden":`true`}),`Save`]})]}),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-[13px]`,children:[(0,X.jsx)(`div`,{role:`group`,"aria-label":`When to sync`,className:`flex flex-wrap gap-2`,children:(0,X.jsx)(oe,{items:St.map(e=>({id:e.id,label:e.label,icon:e.icon})),value:i,onChange:a})}),i===`daily`&&(0,X.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Time (this computer's clock)`,(0,X.jsx)(k,{type:`time`,step:60,value:o,onChange:e=>c(e.target.value)})]}),i!==`off`&&p&&p.steps.length>0&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsxs)(`label`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(K,{checked:h,onCheckedChange:e=>g(e===!0),"aria-label":`Also discover the tests`}),(0,X.jsx)(`span`,{children:`Also discover the tests first. This runs the repository's code with these commands, with no secret of ForgeQE's. If the test projects change, the schedule stops discovering until you confirm again.`})]}),h&&(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.steps.map((e,t)=>(0,X.jsx)(`li`,{children:(0,X.jsx)(`code`,{className:`rounded-[8px] bg-surface-strong px-2 py-1 font-mono text-[13px] [overflow-wrap:anywhere]`,children:e.command})},t))})]}),n?.every===`custom`&&(0,X.jsxs)(`p`,{className:`m-0 text-warn`,children:[`The sync job was changed outside this page (`,n.text,`). Saving here replaces it.`]}),n?.enabled===!1&&(0,X.jsx)(`p`,{className:`m-0 text-warn`,children:`The sync job is disabled in the jobs service.`}),n?.last&&(0,X.jsxs)(`p`,{className:`m-0 text-ink-2`,children:[`Last scheduled sync `,he(n.last.at),`: `,n.last.status.replace(`_`,` `),`.`]}),l&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:l})]})})}var Et={forgeqe:{label:`ForgeQE`,icon:v},script:{label:`Tests`,icon:d}},Dt=e=>Et[e]??{label:e===`azure_devops`?`Azure DevOps`:e===`jira`?`Jira`:e,icon:x},Ot=e=>e!==`forgeqe`&&e!==`script`,kt=[];function At({tags:e,cases:t=[],onChanged:n}){let[r,i]=(0,q.useState)(`all`),[a,o]=(0,q.useState)(null),s=e=>e.system===`azure_devops`||e.system===`jira`,c=e=>t.filter(t=>t.ownTags.includes(e)&&!t.trackerTags.includes(e)&&s(t)).map(e=>e.key),l=e=>t.filter(t=>t.ownTags.includes(e)&&t.trackerTags.includes(e)&&s(t)).map(e=>e.key),u=e.tags.filter(e=>r===`all`||(r===`out`?e.outOfStep>0:r===`tracker`?e.from.some(Ot):e.from.includes(r))),f=(e,t)=>t?`${Math.round(e/t*100)}%`:`–`;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,X.jsxs)(le,{label:`Tags`,children:[(0,X.jsx)(W,{compact:!0,label:`Tags in use`,icon:g,value:e.tags.length}),(0,X.jsx)(W,{compact:!0,label:`Test cases with a tag`,value:f(e.casesTagged,e.cases),note:`${e.casesTagged} of ${e.cases}`}),(0,X.jsx)(W,{compact:!0,label:`Tests with a tag`,value:f(e.testsTagged,e.tests),note:`${e.testsTagged} of ${e.tests}`}),(0,X.jsx)(W,{compact:!0,label:`Out of step`,icon:D,value:e.tags.filter(e=>e.outOfStep).length,tone:e.tags.some(e=>e.outOfStep)?`text-warn`:void 0,note:`a case's tag its test lacks`})]}),(0,X.jsx)(V,{label:`Tags`,placeholder:`Find a tag`,resetKey:r,empty:e.tags.length?`Nothing matches.`:`No tags yet: tag cases in Test cases, or in their system.`,tools:(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,X.jsx)(oe,{items:[{id:`all`,label:`All`,n:e.tags.length},{id:`tracker`,label:`From their systems`,icon:x,n:e.tags.filter(e=>e.from.some(Ot)).length},{id:`script`,label:`From tests`,icon:d,n:e.tags.filter(e=>e.from.includes(`script`)).length},{id:`forgeqe`,label:`ForgeQE's`,icon:v,n:e.tags.filter(e=>e.from.includes(`forgeqe`)).length},{id:`out`,label:`Out of step`,icon:D,n:e.tags.filter(e=>e.outOfStep).length,alert:!0}],value:r,onChange:i})}),head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{className:O(R,`w-[28%]`),children:`Tag`}),(0,X.jsx)(`th`,{className:R,children:`Comes from`}),(0,X.jsx)(`th`,{className:U,children:`Test cases`}),(0,X.jsx)(`th`,{className:U,children:`Tests`}),(0,X.jsx)(`th`,{className:O(R,`hidden @xl:table-cell`),children:`Out of step`}),(0,X.jsx)(`th`,{className:O(R,`hidden @2xl:table-cell`),children:`Used by suites`}),(0,X.jsx)(`th`,{className:R,children:(0,X.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:u.map(e=>(0,X.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,X.jsx)(`td`,{className:H,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-2 rounded-[6px] bg-surface-strong px-2 text-[13px] font-medium`,children:[(0,X.jsx)(g,{size:12,"aria-hidden":`true`}),e.name]})}),(0,X.jsx)(`td`,{className:H,children:(0,X.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:e.from.map(e=>{let t=Dt(e);return(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-[6px] border border-line px-2 text-[13px] text-ink-2`,children:[(0,X.jsx)(t.icon,{size:12,"aria-hidden":`true`}),t.label]},e)})})}),(0,X.jsx)(`td`,{className:z,children:e.cases}),(0,X.jsx)(`td`,{className:z,children:e.tests}),(0,X.jsx)(`td`,{className:O(H,`hidden @xl:table-cell`),children:e.outOfStep?(0,X.jsx)(A,{tone:`warn`,children:e.outOfStep}):(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:`–`})}),(0,X.jsx)(`td`,{className:O(H,`hidden text-[13px] text-ink-2 @2xl:table-cell`),children:e.suites.join(`, `)||`–`}),(0,X.jsxs)(`td`,{className:O(H,`text-right`),children:[c(e.name).length>0&&(0,X.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Write the tag ${e.name} to the trackers of ${c(e.name).length} cases`,"data-tip":`Write to the trackers of ${c(e.name).length} cases`,onClick:()=>o({kind:`tags`,keys:c(e.name)}),children:(0,X.jsx)(E,{"aria-hidden":`true`})}),l(e.name).length>0&&(0,X.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Take the tag ${e.name} off in the trackers of ${l(e.name).length} cases`,"data-tip":`Take off in the trackers of ${l(e.name).length} cases`,onClick:()=>o({kind:`untag`,keys:l(e.name),tags:[e.name]}),children:(0,X.jsx)(b,{"aria-hidden":`true`})})]})]},e.name))}),(0,X.jsx)(Ae,{kind:a?.kind??null,keys:a?.keys??kt,tags:a?.tags,onClose:()=>o(null),onDone:e=>n?.(e)})]})}var jt=[`dashboard`,`cases`,`tests`,`gaps`,`suites`,`tags`];function Mt({sub:n}){let r=(n??``).split(`/`).filter(Boolean),i=jt.includes(r[0])?r[0]:`dashboard`,a=i===`cases`&&r[1]?ae(r[1]):void 0,o=i===`suites`&&r[1]?ae(r[1]):void 0,[s,c]=(0,q.useState)(null),[u,f]=(0,q.useState)(null),[p,m]=(0,q.useState)(null),[h,_]=(0,q.useState)([]),[y,b]=(0,q.useState)(null),[x,ee]=(0,q.useState)(null),[S,C]=(0,q.useState)(null),[w,T]=(0,q.useState)(``),[E,D]=(0,q.useState)(``),[ne,re]=(0,q.useState)(!1),[ie,k]=(0,q.useState)([]),[j,M]=(0,q.useState)(null),[N,P]=(0,q.useState)(!0),I=(0,q.useCallback)(async()=>{try{let[e,t]=await Promise.all([J.view(),J.cases()]);c(e),f(t),ee(e.suites),C(e.job),T(``)}catch(e){T(e.message)}},[]);(0,q.useEffect)(()=>{I()},[I]),(0,q.useEffect)(()=>{i===`gaps`&&J.gaps().then(m,e=>T(e.message)),i===`tags`&&J.tags().then(b,e=>T(e.message)),i===`suites`&&J.suites().then(e=>ee(e.suites),e=>T(e.message))},[i,s]),(0,q.useEffect)(()=>{if(!S?.running)return;let e=setInterval(()=>{J.job().then(e=>{C(e.job),e.job?.running||I()},()=>{})},2e3);return()=>clearInterval(e)},[S?.running,I]);let oe=async()=>{re(!0),D(``);try{let e=await J.sync(),t=e.plans.filter(e=>e.error);D(t.length?t.map(e=>`${e.label}: ${e.error}`).join(` · `):`Synced ${e.plans.map(e=>`${e.label} (${e.cases} cases)`).join(`, `)}.`),await I()}catch(e){T(e.message)}finally{re(!1)}},R=e=>M({title:`Run ${e.length} test case${e.length===1?``:`s`}`,go:(t,n)=>J.run(e,t,n)}),z=(e,t)=>{let n=x?.find(t=>t.id===e)??s?.suites.find(t=>t.id===e);M({title:`${t?`Rerun the failed cases of`:`Run`} ${n?.name??`the suite`}`,go:(n,r)=>J.runSuite(e,{...n?{env:n}:{},...t?{only:t}:{}},r)})},B=()=>{D(`The run started: it shows here while it runs, and in Runs.`),J.job().then(e=>C(e.job),()=>{})},V=e=>{D(e),k([]),I()},H=new Map((u?.cases??[]).map(e=>[e.key,e])),U=ie.filter(e=>H.has(e)),le=e=>e.map(e=>H.get(e).id),de=U.filter(e=>[`failed`,`blocked`].includes(H.get(e).lastRun.outcome)),W=U.filter(e=>H.get(e).automation!==`automated`),K=[{intent:`automate`,label:W.length?`Automate ${W.length}`:`Automate`,icon:d,keys:W.slice(0,50),...W.length?{}:{disabled:`Pick test cases that are not automated`}},{intent:`investigate`,label:de.length?`Why ${de.length} fail`:`Why they fail`,icon:l,keys:de.slice(0,50),...de.length?{}:{disabled:`Pick failing test cases`}},{intent:`tag`,label:`Suggest tags`,icon:g,keys:U.slice(0,50),...U.length?{}:{disabled:`Pick test cases in the list first`}},{intent:`tag_tests`,label:`Write tags into tests`,icon:d,keys:U.filter(e=>H.get(e).tests.length>0&&H.get(e).tags.length>0).slice(0,50),...U.filter(e=>H.get(e).tests.length>0&&H.get(e).tags.length>0).length?{}:{disabled:`Pick tagged cases that have a linked test`}}],ge=(p?.ranked??[]).slice(0,20).map(e=>e.key),_e=[{intent:`automate`,label:U.length?`Automate ${U.length}`:`Automate the top ${ge.length}`,icon:d,keys:(U.length?U:ge).slice(0,50),...U.length||ge.length?{}:{disabled:`Nothing left to automate`}},{intent:`investigate`,label:`Why the failing fail`,icon:l,keys:(p?.lists.failing??[]).slice(0,50),...p?.lists.failing.length?{}:{disabled:`Nothing is failing`}},{intent:`cases_for_stories`,label:h.length?`Cases for ${h.length} stor${h.length===1?`y`:`ies`}`:`Cases for stories with none`,icon:v,keys:[],stories:(h.length?h:(p?.stories?.noCase??[]).map(e=>e.id)).slice(0,50),...h.length||p?.stories?.noCase.length?{}:{disabled:`Read the release's stories in Gaps, Stories with no case, first`}}],ve=o?x?.find(e=>e.id===o):void 0,ye=(0,X.jsxs)(`main`,{className:O(ue,`@container flex-auto gap-4`),children:[(0,X.jsx)(me,{}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,X.jsx)(ce,{pixel:se[`test-management`],size:`lg`}),(0,X.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test management`}),s&&(0,X.jsx)(pe,{label:`Test management`,className:`mb-0`,current:i,onPick:e=>location.hash=F(`test-management`,e),tabs:[{id:`dashboard`,label:`Dashboard`},{id:`cases`,label:`Test cases`,n:s.summary.cases},{id:`tests`,label:`Automated`,n:s.summary.tests},{id:`gaps`,label:`Gaps`,n:s.summary.notAutomated+s.summary.pending+s.summary.failing},{id:`suites`,label:`Suites`,n:s.suites.length},{id:`tags`,label:`Tags`}]}),s&&(0,X.jsxs)(`span`,{className:`ml-auto flex flex-wrap items-center gap-2 text-[13px] text-muted`,children:[s.plans.length>0&&(0,X.jsxs)(`span`,{"data-tip":s.plans.map(e=>`${e.label}: ${e.cases} cases${e.at?`, synced ${he(e.at)}`:``}`).join(` · `),children:[s.plans.length,` plan`,s.plans.length===1?``:`s`,s.plans[0]?.at?`, synced ${G(s.plans.map(e=>e.at??``).sort()[0])}`:`, not synced yet`]}),s.plans.length>0&&(0,X.jsxs)(L,{size:`sm`,disabled:ne,onClick:()=>void oe(),"data-tip":`Read every case of the connected plans again`,children:[(0,X.jsx)(t,{"aria-hidden":`true`}),ne?`Syncing…`:`Sync`]}),(s.plans.length>0||s.summary.tests>0)&&(0,X.jsx)(wt,{disabled:ne}),(i===`cases`||i===`gaps`||i===`suites`)&&!N&&(0,X.jsxs)(L,{size:`sm`,onClick:()=>P(!0),children:[(0,X.jsx)(v,{"aria-hidden":`true`}),i===`suites`?`Suite agent`:`Agent`]})]})]}),w&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:w}),!s&&!w&&(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),E&&(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:E}),s&&s.refused.length>0&&(0,X.jsxs)(`p`,{className:`m-0 text-[13px] text-warn`,children:[`Not read, as their system does not write a plan that way: `,s.refused.join(` · `),`. Fix them in Settings › Integrations.`]}),S&&(0,X.jsxs)(`div`,{role:`status`,className:`flex flex-wrap items-center gap-2 rounded-[12px] border border-line px-4 py-2 text-[13px]`,children:[(0,X.jsx)(A,{tone:S.running?`running`:S.exitCode===0?`pass`:`fail`,children:S.running?`Running`:S.exitCode===0?`Finished`:`Stopped`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-ink-2`,"data-tip":S.command,children:S.lines.at(-1)??S.command}),S.running?(0,X.jsxs)(L,{size:`sm`,variant:`danger`,onClick:()=>void J.stop().then(e=>C(e.job)),children:[(0,X.jsx)(te,{"aria-hidden":`true`}),`Stop`]}):(0,X.jsx)(`a`,{href:F(`runs`),className:`text-[13px]`,children:`Runs`})]}),s&&(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(`div`,{id:`panel-${i}`,role:`tabpanel`,"aria-labelledby":`tab-${i}`,className:`flex flex-col gap-4`,children:[i===`dashboard`&&(0,X.jsx)(ot,{view:s,onRunSuite:z}),i===`cases`&&(a?(0,X.jsx)(Xe,{caseKey:a,onRun:R}):u&&(0,X.jsx)(et,{cases:u.cases,tests:u.tests.length,selected:U,onSelect:k,onRun:R,onChanged:V})),i===`tests`&&u&&(0,X.jsx)(Ue,{cases:u.cases,onChanged:V}),i===`gaps`&&(p&&u?(0,X.jsx)(gt,{gaps:p,cases:u.cases,tests:u.tests,selected:U,onSelect:k,onRun:R,pickedStories:h,onPickStories:_,onStoriesRead:()=>(_([]),void I())}):(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`})),i===`suites`&&(o?(0,X.jsx)(bt,{id:o,onRun:z,onDeleted:()=>(location.hash=F(`test-management`,`suites`),void I())},o):x&&(0,X.jsx)(yt,{suites:x,onRun:z})),i===`tags`&&(y?(0,X.jsx)(At,{tags:y,cases:u?.cases,onChanged:V}):(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}))]})}),(0,X.jsx)(Be,{open:!!j,onClose:()=>M(null),title:j?.title??`Run`,preview:(e,t)=>j.go(e,t),onStarted:B})]}),Y=a?H.get(a):void 0;return(0,X.jsxs)(`div`,{className:`@container flex min-h-(--screen) flex-col`,children:[(0,X.jsx)(fe,{}),(0,X.jsxs)(`div`,{className:`flex flex-auto flex-col xl:flex-row`,children:[(0,X.jsx)(`div`,{className:`flex min-w-0 flex-auto flex-col`,children:ye}),s&&N&&i===`cases`&&(0,X.jsx)(xe,{title:`Test case agent`,about:`Automates, runs and tags the cases you pick.`,looking:Y?`Looking at ${Y.id}.`:U.length?`Looking at the ${U.length} cases you picked.`:`Looking at ${s.summary.cases} test cases. Pick some in the list.`,context:Y?[Y.id,...Y.plans.slice(0,1)]:U.length?le(U).slice(0,4):[],suggestions:Y?[{intent:Y.automation===`automated`?`run`:`automate`,label:Y.automation===`automated`?`Run it and explain`:`Automate it`,icon:Y.automation===`automated`?e:d,keys:[Y.key]},{intent:`investigate`,label:`Why it fails`,icon:l,keys:[Y.key],...[`failed`,`blocked`].includes(Y.lastRun.outcome)?{}:{disabled:`Its last run did not fail`}},{intent:`tag`,label:`Suggest tags`,icon:g,keys:[Y.key]}]:K,placeholder:`Ask about these cases, or say what to do`,onClose:()=>P(!1)},a??`list`),s&&N&&i===`gaps`&&(0,X.jsx)(xe,{title:`Gap agent`,about:`Finds what to close first and closes it with you.`,looking:`Looking at ${s.summary.notAutomated} cases not automated, ${s.summary.pending} pending and ${s.summary.failing} failing.`,context:U.length?le(U).slice(0,4):[],suggestions:_e,placeholder:`What should we close first?`,onClose:()=>P(!1)}),s&&N&&i===`suites`&&(0,X.jsx)(xt,{open:ve,onSaved:e=>{D(`Saved the suite ${e.name}.`),I(),location.hash=F(`test-management`,`suites`,e.id)}})]})]})}export{Mt as TestManagement};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,V as t}from"./filters-CVzIOjPG.js";import{i as n,o as r,ot as i,t as a}from"./frame-VTMu7MoC.js";import{l as o,u as s}from"./index-nuLrB-Rb.js";var c=e(),l=`agent`;function u({page:e,title:u,label:d,tabs:f,current:p,onPick:m,below:h,end:g,agentBody:_,keepAgent:v=!1,wide:y=!1,children:b}){let x=(0,c.jsx)(i,{label:d,current:p,onPick:m,tabs:[{id:l,label:`Agent`},...f],className:`mb-0`}),S=p===l,C=(i,s)=>(0,c.jsxs)(`div`,{className:`@container flex min-h-(--screen) flex-col`,children:[(0,c.jsx)(r,{}),(0,c.jsxs)(`main`,{className:t(a,n,`@container flex-auto gap-4`),children:[(0,c.jsx)(o,{agent:e,...u?{title:u}:{},tabs:x,end:g}),(0,c.jsx)(`div`,{role:`tabpanel`,id:`panel-${s}`,"aria-labelledby":`tab-${s}`,className:t(`flex min-w-0 flex-col gap-4`,y&&t(`@container [--wide-w:min(var(--wide-max,100000px),calc(var(--page-w)_-_48px))] md:[--wide-w:min(var(--wide-max,100000px),calc(var(--page-w)_-_96px))] w-(--wide-w) max-w-none self-start ml-[calc((100%_-_var(--wide-w))/2)]`,`[--wide-max:1384px]`)),children:i})]})]}),w=_===void 0?(0,c.jsx)(s,{agent:e,...u?{title:u}:{},tabs:x,below:h,end:g}):C(_,l);return v?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`div`,{hidden:!S,children:w}),!S&&C(b,p)]}):S?w:C(b,p)}export{u as n,l as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{Ir as e,nr as t,zr as n}from"./line-icons-C_amZ5-o.js";import{$t as r,B as i,H as a,V as o,c as s,dt as c,i as l,n as u,u as d,z as f}from"./filters-CVzIOjPG.js";import{$ as p,X as m,et as h,tt as g}from"./frame-VTMu7MoC.js";import"./markdown-CWisJbSJ.js";var _=n(e(),1),v=r(),y={test:[`Testing the connection`,`Tested the connection`,`waiting`],tables:[`Reading the tables`,`Read the tables`,`searching`],query:[`Running the query`,`Ran the query`,`working`],gen:[`Making a preview`,`Made a preview`,`writing`],files:[`Writing the files`,`Wrote the files`,`writing`],insert:[`Inserting test data`,`Inserted test data`,`working`],batches:[`Listing the batches`,`Listed the batches`,`searching`],clean:[`Removing a batch`,`Removed a batch`,`working`],request:[`Asking Miner for test data`,`Asked Miner for test data`,`thinking`],fetch:[`Fetching the request again`,`Fetched the request again`,`searching`],ask:[`Asking Miner`,`Asked Miner`,`thinking`],checks:[`Running the checks`,`Ran the checks`,`working`],map:[`Reading the schema`,`Read the schema`,`searching`],check:[`Checking the flows`,`Checked the flows`,`working`],trace:[`Following the record`,`Followed the record`,`searching`]};function b(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(!1),o=(0,_.useCallback)(()=>{c.view().then(e=>{t(e),r(``)},e=>r(e.message))},[]);(0,_.useEffect)(o,[o]);let s=!!e?.job?.running;return(0,_.useEffect)(()=>{if(!s)return;let e=setInterval(o,1e3);return()=>clearInterval(e)},[s,o]),{view:e,error:n,busy:i||s,running:s,act:async(e,t)=>{a(!0),r(``);try{await c.run(e,t),o()}catch(e){r(e.message)}finally{a(!1)}},stop:()=>void c.stop().then(o),load:o,job:e?.job??null}}var x=e=>e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e);function S({file:e,onNote:t}){return(0,v.jsx)(`button`,{type:`button`,"data-tip":e,onClick:async()=>t(await d(e)),className:o(i({size:`sm`}),`font-mono text-[13px]`),children:e.split(/[\\/]/).pop()})}function C({children:e,label:t}){return(0,v.jsx)(`pre`,{"aria-label":t,className:`m-0 max-h-[320px] overflow-auto rounded-[12px] bg-surface-muted p-4 font-mono text-[13px] leading-relaxed whitespace-pre text-ink-2`,children:e})}function w({job:e,onStop:n,words:r}){let[i,o,c]=(r??y)[e.kind]??[`Working`,`Done`,`working`],l=(0,_.useRef)(null);(0,_.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[e.lines.length]);let u=e.exitCode===0,d=!u&&(e.kind===`check`||e.kind===`trace`)&&e.result!==void 0&&!e.result.error;return(0,v.jsxs)(`section`,{"aria-label":e.running?i:o,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,v.jsxs)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:[e.running?i:o,e.target?(0,v.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,e.target]}):null]}),(0,v.jsx)(s,{tone:e.running?`running`:u?`pass`:e.exitCode===2||d?`warn`:`fail`,orb:c,children:e.running?`Working`:u?`Done`:d?`Some broken`:e.exitCode===2?`Not done`:`Failed`}),e.running&&(0,v.jsxs)(f,{variant:`danger`,onClick:n,children:[(0,v.jsx)(t,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,v.jsxs)(`details`,{open:e.running||!u&&!e.result,children:[(0,v.jsxs)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:[`Output (`,a(e.lines.length,`line`),`)`]}),(0,v.jsx)(`code`,{className:`mt-2 block font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.command}),(0,v.jsx)(`pre`,{ref:l,className:`mt-2 max-h-[240px] overflow-auto rounded-[10px] bg-surface-muted p-4 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:e.lines.join(`
|
|
2
|
-
`)||`Starting…`})]})]})}function T({text:e}){return(0,v.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e})}function E({columns:e,rows:t}){let n=e.map((e,n)=>t.length>0&&t.every(e=>e[n]===null||e[n]===void 0||typeof e[n]==`number`)&&t.some(e=>typeof e[n]==`number`));return(0,v.jsx)(m,{label:`Rows`,resetKey:t,head:e.map((e,t)=>(0,v.jsx)(`th`,{className:n[t]?h:p,children:e},e)),children:t.map((e,t)=>(0,v.jsx)(`tr`,{className:g,children:e.map((e,t)=>(0,v.jsx)(`td`,{"data-tip":x(e),className:o(`px-4 py-2 font-mono text-[13px]`,n[t]?`text-right whitespace-nowrap tabular-nums`:`max-w-[320px] truncate`,e==null&&`text-muted`),children:x(e)},t))},t))})}function D({r:e}){return(0,v.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(e.order||[]).map(t=>{let n=e.preview?.[t],r=n?.sample||[],i=r.length?Object.keys(r[0]):[];return(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsxs)(`span`,{className:`text-sm`,children:[(0,v.jsx)(`span`,{className:`font-medium`,children:t}),` · `,a(e.rows?.[t]??0,`row`),n?.database_fills?.length?(0,v.jsxs)(`span`,{className:`text-muted`,children:[` · the database fills `,n.database_fills.join(`, `)]}):null,e.masked?.[t]?.length?(0,v.jsxs)(`span`,{className:`text-muted`,children:[` · masked `,e.masked[t].join(`, `)]}):null]}),i.length>0&&(0,v.jsx)(E,{columns:i,rows:r.slice(0,3).map(e=>i.map(t=>e[t]))})]},t)}),(e.warnings||[]).map((e,t)=>(0,v.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:e},t))]})}var O={query:`Existing rows`,generate:`New rows`};function k({r:e,onNote:t}){let n=Object.entries(e.rows||{});return(0,v.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(s,{tone:`pass`,children:O[e.kind||``]||`Answered`}),(0,v.jsxs)(`span`,{className:`min-w-0 text-sm text-ink-2 [overflow-wrap:anywhere]`,children:[e.database,e.why?` · ${e.why}`:``]})]}),n.map(([t,n])=>(0,v.jsx)(A,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(`span`,{className:`text-sm font-medium`,children:`The query, as the database checked it`}),(0,v.jsx)(C,{label:`SQL`,children:e.sql})]}),e.script_preview&&e.script_preview.length>0&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script for these rows, not run`}),(0,v.jsx)(C,{label:`INSERT script`,children:e.script_preview.join(`
|
|
3
|
-
`)})]}),e.files?.length?(0,v.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Kept`,e.files.map(e=>(0,v.jsx)(S,{file:e,onNote:t},e))]}):null,e.replay&&(0,v.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Tests and pipelines get the same data with `,(0,v.jsx)(`code`,{className:`font-mono text-[13px] text-ink-2`,children:e.replay}),`, without a model.`]})]})}function A({title:e,rows:t,total:n}){let r=[...new Set(t.flatMap(e=>Object.keys(e)))];return(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsxs)(`span`,{className:`text-sm`,children:[(0,v.jsx)(`span`,{className:`font-medium`,children:e}),` · `,a(n,`row`),n>t.length?(0,v.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.length,` shown`]}):null]}),r.length>0?(0,v.jsx)(E,{columns:r,rows:t.map(e=>r.map(t=>e[t]))}):(0,v.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No rows match.`})]})}function j({items:e,text:t,label:n,size:r=10,children:i}){let[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(0),d=a.toLowerCase().split(/\s+/).filter(Boolean),f=d.length?e.filter(e=>d.every(n=>t(e).toLowerCase().includes(n))):e;(0,_.useEffect)(()=>c(0),[a,e.length]);let p=Math.min(s,Math.max(0,Math.ceil(f.length/r)-1));return(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.length>r&&(0,v.jsx)(l,{id:`find-${n.toLowerCase().replace(/\W+/g,`-`)}`,label:`Find in ${n.toLowerCase()}`,value:a,onChange:o,className:`flex-none`}),f.length?(0,v.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:f.slice(p*r,p*r+r).map(i)}):(0,v.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing matches.`}),f.length>r&&(0,v.jsx)(u,{page:p,size:r,total:f.length,onPage:c,label:`Pages of ${n.toLowerCase()}`})]})}export{w as a,T as c,x as d,b as f,D as i,E as l,C as n,O as o,S as r,j as s,k as t,A as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$t as e,V as t}from"./filters-CVzIOjPG.js";var n=e();function r({diff:e,className:r}){let i=0,a=0,o=e.split(`
|
|
2
|
-
`).flatMap((e,t)=>{if(/^(diff |index |--- |\+\+\+ )/.test(e))return[];let n=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(e);return n?(i=Number(n[1]),a=Number(n[2]),[{key:t,kind:`hunk`,text:e,a:``,b:``}]):e.startsWith(`+`)?[{key:t,kind:`add`,text:e.slice(1),a:``,b:String(a++)}]:e.startsWith(`-`)?[{key:t,kind:`del`,text:e.slice(1),a:String(i++),b:``}]:e.startsWith(`\\`)?[{key:t,kind:`hunk`,text:e,a:``,b:``}]:[{key:t,kind:`same`,text:e.startsWith(` `)?e.slice(1):e,a:String(i++),b:String(a++)}]});return(0,n.jsx)(`div`,{className:t(`max-h-[420px] overflow-auto rounded-[10px] border border-line-soft bg-bg font-mono text-[13px] leading-[1.6]`,r),children:(0,n.jsx)(`table`,{className:`w-full border-collapse`,children:(0,n.jsx)(`tbody`,{children:o.map(e=>(0,n.jsxs)(`tr`,{className:e.kind===`add`?`bg-pass-soft`:e.kind===`del`?`bg-fail-soft`:e.kind===`hunk`?`bg-surface-muted`:void 0,children:[(0,n.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.a}),(0,n.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.b}),(0,n.jsx)(`td`,{"aria-hidden":`true`,className:t(`w-4 align-top select-none`,e.kind===`add`?`text-pass`:e.kind===`del`?`text-fail`:`text-muted`),children:e.kind===`add`?`+`:e.kind===`del`?`−`:``}),(0,n.jsxs)(`td`,{className:t(`pr-4 align-top whitespace-pre`,e.kind===`hunk`?`text-muted`:`text-ink`),children:[(0,n.jsx)(`span`,{className:`sr-only`,children:e.kind===`add`?`added: `:e.kind===`del`?`removed: `:``}),e.text||` `]})]},e.key))})})})}export{r as t};
|