app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

commit 6ab9526b427e187390c391aa289efe278c38267b
parent 9775b48a459159d628bb9555f0d380aa2d96f495
Author: triesap <tyson@radroots.org>
Date:   Sun, 11 Oct 2026 22:55:14 +0000

test: align guest screen consumers with approved UI (HCP-148)

- Require the approved single Find food heading in the static guest shell
- Check the current disabled Messages connect gate and explicit unlock privacy
- Scope Identity disclosure assertions while preserving connection and focus checks
- Bind complete web verification and independent source acceptance

Diffstat:
Mweb/tests/e2e/capability-gate.spec.ts | 13+++++++++++--
Mweb/tests/integration/loopback.test.ts | 5++++-
Mweb/tests/unit/bootstrap.test.ts | 3++-
3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/web/tests/e2e/capability-gate.spec.ts b/web/tests/e2e/capability-gate.spec.ts @@ -95,7 +95,11 @@ test('explicit Connect is enabled after hydration and never repeats Send', async expect(await main.textContent()).not.toContain( 'HC_TEST_RAW_PROVIDER_DIAGNOSTIC' ); - await page.locator('summary').click(); + await page + .getByRole('navigation', { name: 'Primary', exact: true }) + .locator('summary') + .filter({ hasText: /^Identity$/ }) + .click(); await page.getByRole('button', { name: 'Disconnect', exact: true }).click(); await expect(connect).toBeEnabled(); expect(await page.evaluate(() => window.hcp056Counts.keys)).toBe(1); @@ -259,7 +263,12 @@ test('Disconnect while approval is pending keeps the real slot and fences late c ).toBeVisible(); expect(await page.evaluate(() => window.hcp056Counts.keys)).toBe(1); await page.evaluate(() => window.hcp056Release?.()); - await expect(page.locator('summary')).toHaveCount(0); + await expect( + page + .getByRole('navigation', { name: 'Primary', exact: true }) + .locator('summary') + .filter({ hasText: /^Identity$/ }) + ).toHaveCount(0); await expect(main.locator('input, textarea, form')).toHaveCount(0); expect(await page.evaluate(() => window.hcp056Counts)).toEqual({ keys: 1, diff --git a/web/tests/integration/loopback.test.ts b/web/tests/integration/loopback.test.ts @@ -86,9 +86,12 @@ await test('navigation fallback serves actual separate output and preserves miss /No listings yet\.|<h2>Needs attention|<h2>Drafts|<h2>Listings/ ); } else { + assert.match(html, /Messaging is disabled in this build\./); + assert.match(html, /Connect to continue/); + assert.match(html, /<button[^>]*disabled[^>]*>Connect extension/); assert.match( html, - /Private views and editing are unavailable during development/ + /Messages stay hidden until you connect and explicitly unlock your inbox\./ ); } assert.doesNotMatch(html, /<form|<input|<textarea/); diff --git a/web/tests/unit/bootstrap.test.ts b/web/tests/unit/bootstrap.test.ts @@ -36,7 +36,8 @@ describe('static guest shell', () => { expect(html).toMatch(/<button[^>]*type="submit"[^>]*disabled[^>]*>Search/); expect(html).toMatch(/<textarea[^>]*disabled/); expect(html).not.toContain('Search is unavailable during development.'); - expect(html).not.toContain('<h1>'); + expect(html.match(/<h1\b/g)).toHaveLength(1); + expect(html).toContain('<h1>Find food</h1>'); }); it('composes the actual shared shell and preserves the route body without a global h1', () => { const output = render(Shell);