| index e72531a7..fd874c57 100644 |
| --- a/internal/headless/browser_review_test.go |
| +++ b/internal/headless/browser_review_test.go |
| @@ -4,6 +4,7 @@ package headless |
| |
| import ( |
| "testing" |
| + "time" |
| |
| "amadan.net/oficina/equipo/internal/browsertest" |
| ) |
| @@ -34,6 +35,9 @@ func TestBrowserReceiptFollowsReview(t *testing.T) { |
| // Paul, staging: the sidebar reads the thin core and follows the stream. |
| // While a step runs, Engineering says it is working on the task (linked) |
| // and Tasks counts it; at 1280 and at 390 (inside the menu), no reload. |
| +// Then checks pass and Review approves, and Equipo merges it on its own |
| +// (slice 4c): the specialists go idle, Tasks stops counting it and |
| +// Needs you never does. |
| func TestBrowserRailFollowsWork(t *testing.T) { |
| for _, size := range []struct { |
| w, h int64 |
| @@ -48,10 +52,12 @@ func TestBrowserRailFollowsWork(t *testing.T) { |
| p.check(eng+`.dataset.state==='idle' && !document.querySelector('#nav-tasks [data-count]') && !document.querySelector('#rail [data-specialist="product"]')`, "idle sidebar") |
| p.send("tool:record_task:oficina/sample|Slow sidebar change|x\ntool:start_task:$task|stepsleep:2500 edit:README.md|teh panes|the panes") |
| p.run(browsertest.Wait(eng + `?.dataset.state==='working' && ` + eng + `.querySelector('[equipo-nav-task]')?.textContent==='Slow sidebar change' && document.querySelector('#nav-tasks [data-count]')?.textContent==='1'`)) |
| - p.run(browsertest.Wait(`document.querySelector('#rail [data-specialist="engineering"]')?.dataset.state==='idle'`)) |
| - p.run(browsertest.Wait(`document.querySelector('#rail [data-specialist="review"]')?.dataset.state==='idle'`)) |
| - // Checks and review, then ready to merge: it needs the person. |
| - p.run(browsertest.Wait(`document.querySelector('#nav-needs-you [data-count]')?.textContent==='1'`)) |
| + // The step sleeps 2.5 s on purpose; on a loaded machine the |
| + // runner's report and the sidebar's swap need more than the 2.5 s |
| + // a 5 s wait leaves after it. |
| + p.run(browsertest.WaitWithin(`document.querySelector('#rail [data-specialist="engineering"]')?.dataset.state==='idle'`, 20*time.Second)) |
| + p.run(browsertest.WaitWithin(`document.querySelector('#rail [data-specialist="review"]')?.dataset.state==='idle' && !document.querySelector('#nav-tasks [data-count]')`, 20*time.Second)) |
| + p.check(`!document.querySelector('#nav-needs-you [data-count]')`, "a task Equipo merged on its own counts as needing the person") |
| p.check(`performance.getEntriesByType('navigation').length===window.__nav`, "the page reloaded") |
| p.stop() |
| } |