Files
member-console/internal/server/testdata/operator_activity/feed.html
T
cgalo5758 2fd63eaca2 Characterize the recent-activity feed: its rows, its failed reads, its reads per event and the landing's paging
No production file changes. The feed's output is unchanged because nothing
the page runs was edited; the commit adds tests, one kit function and the
files the golden compares with.

TestRecentActivityGolden builds nine organizations on one World, for ten
cases (the floor, an upgrade and a revocation on a plan the type defaults
to; an upgrade by a subscription that then ends and resumes the grant; a
live extension; an extension of a grant on hold; a ladder of its own; a
reorder after the tier changes; the console's own removal of a tier, which
writes the only end row with no rank; invoices and payments around one
instant; two organizations with one invoice each at one instant). It
compares the events the feed lists for them, in order, as JSON, and the
activity panel's render of those events, with files under
testdata/operator_activity. Instants are named t01 and on, newest first,
because only their order is a fact. The files were read against the fixture
before they were committed. The feed's four existing readers now go through
wholeFeed.

TestRecentActivityReadFailures fails each of ten reads in turn (the four
sources, the product, the tiers, the organization, the person, a handler
without a database and a closed one) and pins the events the feed keeps and
the warning it writes. TestRecentActivityReadsPerEvent grows the feed by two
organizations on a scratch database and expects exactly the product,
ladder, organization and person reads of two more of each, and no change in
the four source reads or the raw ladder read. The landing page tests read
GET /operator on a scratch database: each source is cut at 100 rows (the
101st invoice is on no page and the pager counts the 101 events the feed
holds), and a feed of 30 events pages by act_page and act_per, with a page
past the end showing page 1 and an unknown size reading as 10.
dbtest.CountedAt is Counted over a given address.

Shown to change no output: 33 breaks of the feed's code, each applied on its
own, are all caught by the new tests; the tests of ./internal/server and
./internal/testkit/... pass three times in a row, each on a reset database,
with no test or subtest of the parent missing or changed in result and 19
added in ./internal/server (the golden, the failure table and its ten
subtests, the reads test, the cut test, the paging test and its four
subtests); the golden passes a second run without -update and leaves the
tree unchanged.

Unprobed, and why:
- Each source is read once per render: no one-line edit doubles a source
  read without also changing the rows.
- The order of two warnings when two sources fail: no subtest fails two
  reads.
- The When cells: the golden replaces them with tokens, and the test of
  billing events' times pins their text.
- The template's id fallback for an unnamed organization or actor: the
  overview render tests, which build their events by hand, pin it.
- An extension older than the transitions window shows as its grant row:
  pinning it needs about 100 later tier changes.
2026-10-09 21:23:00 -05:00

612 lines
37 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div id="activity-panel">
<div class="card mb-3">
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover table-sm table-record">
<thead>
<tr>
<th scope="col">Summary</th>
<th scope="col">When</th>
<th scope="col">Event</th>
<th scope="col">Organization</th>
<th scope="col">Actor</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org G>">Ended: —</a></th>
<td class="text-nowrap"><span class="d-block">t01</span><span class="d-block text-muted">t01</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org G>">Org G</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org G>">Issued Max (complimentary)</a></th>
<td class="text-nowrap"><span class="d-block">t02</span><span class="d-block text-muted">t02</span></td>
<td>
<span class="badge text-bg-light border">Grant</span>
</td>
<td>
<a href="/operator/organizations/<org:Org G>">Org G</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org G>">Started: rank 2</a></th>
<td class="text-nowrap"><span class="d-block">t02</span><span class="d-block text-muted">t02</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org G>">Org G</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org F>">Issued Pro2 (complimentary)</a></th>
<td class="text-nowrap"><span class="d-block">t03</span><span class="d-block text-muted">t03</span></td>
<td>
<span class="badge text-bg-light border">Grant</span>
</td>
<td>
<a href="/operator/organizations/<org:Org F>">Org F</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org F>">Upgraded: Pro2 to Basic</a></th>
<td class="text-nowrap"><span class="d-block">t03</span><span class="d-block text-muted">t03</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org F>">Org F</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org F>">Ended: Pro2</a></th>
<td class="text-nowrap"><span class="d-block">t03</span><span class="d-block text-muted">t03</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org F>">Org F</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org F>">Issued Basic (complimentary)</a></th>
<td class="text-nowrap"><span class="d-block">t04</span><span class="d-block text-muted">t04</span></td>
<td>
<span class="badge text-bg-light border">Grant</span>
</td>
<td>
<a href="/operator/organizations/<org:Org F>">Org F</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org F>">Started: Pro2</a></th>
<td class="text-nowrap"><span class="d-block">t04</span><span class="d-block text-muted">t04</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org F>">Org F</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org E>">Issued Chat Plus (complimentary)</a></th>
<td class="text-nowrap"><span class="d-block">t05</span><span class="d-block text-muted">t05</span></td>
<td>
<span class="badge text-bg-light border">Grant</span>
</td>
<td>
<a href="/operator/organizations/<org:Org E>">Org E</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org E>">Started: Chat Plus</a></th>
<td class="text-nowrap"><span class="d-block">t05</span><span class="d-block text-muted">t05</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org E>">Org E</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org D>">Extended: Plus</a></th>
<td class="text-nowrap"><span class="d-block">t06</span><span class="d-block text-muted">t06</span></td>
<td>
<span class="badge text-bg-light border">Grant</span>
</td>
<td>
<a href="/operator/organizations/<org:Org D>">Org D</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org D>">Upgraded: Plus to Pro</a></th>
<td class="text-nowrap"><span class="d-block">t07</span><span class="d-block text-muted">t07</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org D>">Org D</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org D>">Ended: Plus</a></th>
<td class="text-nowrap"><span class="d-block">t07</span><span class="d-block text-muted">t07</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org D>">Org D</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org D>">Issued Plus (complimentary)</a></th>
<td class="text-nowrap"><span class="d-block">t08</span><span class="d-block text-muted">t08</span></td>
<td>
<span class="badge text-bg-light border">Grant</span>
</td>
<td>
<a href="/operator/organizations/<org:Org D>">Org D</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org D>">Started: Plus</a></th>
<td class="text-nowrap"><span class="d-block">t08</span><span class="d-block text-muted">t08</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org D>">Org D</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org C>">Extended: Plus</a></th>
<td class="text-nowrap"><span class="d-block">t09</span><span class="d-block text-muted">t09</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org C>">Org C</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org C>">Issued Plus (complimentary)</a></th>
<td class="text-nowrap"><span class="d-block">t10</span><span class="d-block text-muted">t10</span></td>
<td>
<span class="badge text-bg-light border">Grant</span>
</td>
<td>
<a href="/operator/organizations/<org:Org C>">Org C</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org C>">Started: Plus</a></th>
<td class="text-nowrap"><span class="d-block">t10</span><span class="d-block text-muted">t10</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org C>">Org C</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org B>">Resumed: Plus</a></th>
<td class="text-nowrap"><span class="d-block">t11</span><span class="d-block text-muted">t11</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org B>">Org B</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org B>">Ended: Pro</a></th>
<td class="text-nowrap"><span class="d-block">t11</span><span class="d-block text-muted">t11</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org B>">Org B</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org B>">Upgraded: Plus to Pro</a></th>
<td class="text-nowrap"><span class="d-block">t12</span><span class="d-block text-muted">t12</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org B>">Org B</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org B>">Ended: Plus</a></th>
<td class="text-nowrap"><span class="d-block">t12</span><span class="d-block text-muted">t12</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org B>">Org B</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org B>">Issued Plus (complimentary)</a></th>
<td class="text-nowrap"><span class="d-block">t13</span><span class="d-block text-muted">t13</span></td>
<td>
<span class="badge text-bg-light border">Grant</span>
</td>
<td>
<a href="/operator/organizations/<org:Org B>">Org B</a>
</td>
<td>
<a href="/operator/persons/<person:Bea>">Bea</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org B>">Started: Plus</a></th>
<td class="text-nowrap"><span class="d-block">t13</span><span class="d-block text-muted">t13</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org B>">Org B</a>
</td>
<td>
<a href="/operator/persons/<person:Bea>">Bea</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org A>">Issued Free (default) after Plus ended</a></th>
<td class="text-nowrap"><span class="d-block">t14</span><span class="d-block text-muted">t14</span></td>
<td>
<span class="badge text-bg-light border">Grant</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org A>">Started: Free</a></th>
<td class="text-nowrap"><span class="d-block">t14</span><span class="d-block text-muted">t14</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org A>">Ended: Plus</a></th>
<td class="text-nowrap"><span class="d-block">t14</span><span class="d-block text-muted">t14</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org A>">Issued Plus (complimentary)</a></th>
<td class="text-nowrap"><span class="d-block">t15</span><span class="d-block text-muted">t15</span></td>
<td>
<span class="badge text-bg-light border">Grant</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/billing/invoices">Invoice USD 50.00 · open</a></th>
<td class="text-nowrap"><span class="d-block">t15</span><span class="d-block text-muted">t15</span></td>
<td>
<span class="badge text-bg-light border">Invoice</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org A>">Upgraded: Free to Plus</a></th>
<td class="text-nowrap"><span class="d-block">t15</span><span class="d-block text-muted">t15</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org A>">Ended: Free</a></th>
<td class="text-nowrap"><span class="d-block">t15</span><span class="d-block text-muted">t15</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<a href="/operator/persons/<person:Ann>">Ann</a>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org A>">Issued Free (default)</a></th>
<td class="text-nowrap"><span class="d-block">t16</span><span class="d-block text-muted">t16</span></td>
<td>
<span class="badge text-bg-light border">Grant</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/organizations/<org:Org A>">Started: Free</a></th>
<td class="text-nowrap"><span class="d-block">t16</span><span class="d-block text-muted">t16</span></td>
<td>
<span class="badge text-bg-light border">Transition</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/billing/payments">Payment USD 100.00 · succeeded</a></th>
<td class="text-nowrap"><span class="d-block">t17</span><span class="d-block text-muted">t17</span></td>
<td>
<span class="badge text-bg-light border">Payment</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/billing/payments">Payment USD 20.00 · failed</a></th>
<td class="text-nowrap"><span class="d-block">t18</span><span class="d-block text-muted">t18</span></td>
<td>
<span class="badge text-bg-light border">Payment</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/billing/invoices">Invoice USD 100.00 · open</a></th>
<td class="text-nowrap"><span class="d-block">t19</span><span class="d-block text-muted">t19</span></td>
<td>
<span class="badge text-bg-light border">Invoice</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/billing/invoices">Invoice USD 20.00 · open</a></th>
<td class="text-nowrap"><span class="d-block">t19</span><span class="d-block text-muted">t19</span></td>
<td>
<span class="badge text-bg-light border">Invoice</span>
</td>
<td>
<a href="/operator/organizations/<org:Org A>">Org A</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/billing/invoices">Invoice USD 10.00 · open</a></th>
<td class="text-nowrap"><span class="d-block">t20</span><span class="d-block text-muted">t20</span></td>
<td>
<span class="badge text-bg-light border">Invoice</span>
</td>
<td>
<a href="/operator/organizations/<org:Zeta>">Zeta</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
<tr>
<th scope="row"><a href="/operator/billing/invoices">Invoice USD 10.00 · open</a></th>
<td class="text-nowrap"><span class="d-block">t20</span><span class="d-block text-muted">t20</span></td>
<td>
<span class="badge text-bg-light border">Invoice</span>
</td>
<td>
<a href="/operator/organizations/<org:Alpha>">Alpha</a>
</td>
<td>
<span class="text-body-secondary">—</span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="d-flex flex-wrap align-items-center justify-content-between gap-2 mt-2">
<p class="small text-body-secondary mb-0">Showing 1–39 of 39</p>
<p class="small text-body-secondary mb-0">Per page:
<a href="/operator" hx-get="/operator" hx-push-url="true" hx-select="#activity-panel" hx-swap="outerHTML" hx-target="#activity-panel">10</a>
<a href="/operator?act_per=25" hx-get="/operator?act_per=25" hx-push-url="true" hx-select="#activity-panel" hx-swap="outerHTML" hx-target="#activity-panel">25</a>
<strong>50</strong>
</p>
</div>
</div>
</div>
</div>