Repository navigation
fix(frontend): EPCIS Preview labels, remove made-up data and dashes, drop Outfit #3554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
897804c
72aa271
574bf49
828d2b9
22ab388
173c1ac
95a8ed3
1f80e86
84e9869
f379d4c
9f29dbd
ba0b26b
d33973f
57610cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| import { execFileSync } from 'node:child_process'; | ||
| import { existsSync, readFileSync } from 'node:fs'; | ||
| import { resolve } from 'node:path'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { CAPABILITY_REGISTRY, STATUS_LABELS } from '@/lib/customer-readiness'; | ||
|
|
||
| const read = (p: string) => readFileSync(resolve(process.cwd(), p), 'utf8'); | ||
|
|
||
| describe('#3554 empty states and hidden sample artifacts', () => { | ||
| it('export-jobs and integrations show No data yet with CSV upload and JSON events API next steps', () => { | ||
| for (const page of ['src/app/dashboard/export-jobs/page.tsx', 'src/app/integrations/page.tsx']) { | ||
| const src = read(page); | ||
| expect(src).toContain('title={NO_DATA_YET}'); | ||
| expect(src).toMatch(/href="\/ingest"/); | ||
| expect(src).toMatch(/href="\/docs\/api"/); | ||
| } | ||
| }); | ||
|
|
||
| it('support pages render Not set for empty channel fields', () => { | ||
| for (const page of ['src/app/settings/support/page.tsx', 'src/app/trust/support/page.tsx']) { | ||
| const src = read(page); | ||
| expect(src).toContain('channel.responseWindow || NOT_SET'); | ||
| expect(src).toContain('channel.notes || NOT_SET'); | ||
| } | ||
| }); | ||
|
|
||
| it('labels the EPCIS capability as Preview', () => { | ||
| const epcis = CAPABILITY_REGISTRY.find((item) => item.id === 'epcis'); | ||
| expect(epcis?.name).toBe('GS1 EPCIS 2.0 (Preview)'); | ||
| expect(epcis && STATUS_LABELS[epcis.status]).toBe('Preview'); | ||
| }); | ||
|
|
||
| it('no longer publishes the made-up proof samples', () => { | ||
| expect(existsSync(resolve(process.cwd(), 'public/proof/fsma-204-sample.csv'))).toBe(false); | ||
| expect(existsSync(resolve(process.cwd(), 'public/proof/epcis-sample.jsonld'))).toBe(false); | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| }); | ||
|
|
||
| it('build_audit_bundle.sh requires a real export path', () => { | ||
| let status = 0; | ||
| let stderr = ''; | ||
| try { | ||
| execFileSync('bash', [resolve(process.cwd(), '../scripts/build_audit_bundle.sh')], { stdio: 'pipe' }); | ||
| } catch (err) { | ||
| const e = err as { status: number; stderr: Buffer }; | ||
| status = e.status; | ||
| stderr = e.stderr.toString(); | ||
| } | ||
| expect(status).not.toBe(0); | ||
| expect(stderr).toMatch(/^usage: /); | ||
| }); | ||
| it('hides /proof/transformation and drops every link to it', () => { | ||
| expect(read('src/app/proof/transformation/page.tsx')).toContain('notFound()'); | ||
| expect(existsSync(resolve(process.cwd(), 'src/app/proof/transformation/opengraph-image.tsx'))).toBe(false); | ||
| expect(read('src/app/sitemap.ts')).not.toContain('/proof/transformation'); | ||
| expect(read('src/app/walkthrough/page.tsx')).not.toContain('/proof/transformation'); | ||
| }); | ||
|
|
||
| it('removes the public proof zips', () => { | ||
| for (const f of ['public/proof/audit-bundle.zip', 'public/proof/audit-bundle-tampered.zip']) { | ||
| expect(existsSync(resolve(process.cwd(), f))).toBe(false); | ||
| } | ||
| }); | ||
|
|
||
| it('security page shows No data yet instead of illustrative verifier output', () => { | ||
| const src = read('src/app/security/page.tsx'); | ||
| expect(src).not.toContain('Sample · illustrative'); | ||
| expect(src).toContain('title={NO_DATA_YET}'); | ||
| }); | ||
|
|
||
| it('CTE pages ask for the user\'s own file, not a sample', () => { | ||
| const src = read('src/app/fsma-204/[cte]/page.tsx'); | ||
| expect(src).not.toContain('Upload a sample'); | ||
| // After merging main (#3557 retired /sandbox), the closing CTA copy comes from | ||
| // sandboxCta().blurb, which asks for the user's own records and links /ingest. | ||
| expect(src).toContain('{cta.blurb}'); | ||
| expect(src).not.toContain('sandbox and get an instant'); | ||
| expect(src).not.toContain('data to the sandbox'); | ||
| expect(src).toMatch(/data to\{" "\}\s*<Link href="\/ingest"[^>]*>RegEngine<\/Link>/); | ||
| }); | ||
| }); | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -56,14 +56,8 @@ describe('public proof-bundle trust copy', () => { | |||||
| } | ||||||
| }); | ||||||
|
|
||||||
| it('/proof states the checks do not authenticate the issuer', () => { | ||||||
| const text = renderedText(<ProofPage />); | ||||||
|
|
||||||
| expect(text).toMatch(/do not authenticate the issuer/i); | ||||||
|
|
||||||
| for (const claim of UNBACKED_AUTHENTICITY_CLAIMS) { | ||||||
| expect(text).not.toMatch(claim); | ||||||
| } | ||||||
| it('/proof is hidden until it can publish artifacts from a real export', () => { | ||||||
| expect(() => ProofPage()).toThrow(); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | Assert the not-found error, not any exception. An unrelated error in Proposed assertion
As per path instructions, “Flag tests that were weakened, skipped, or loosened (broader asserts, removed tenant checks, xfail) to make a change pass.” 📝 Committable suggestion
|
||||||
| }); | ||||||
|
|
||||||
| it('verify_chain.py documents that the uploaded manifest is an untrusted commitment', () => { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality |
Minor | ⚡ Quick win
Remove the claim about public sample EPCIS downloads.
This PR deletes
frontend/public/proof/epcis-sample.jsonld, and the new test checks that the file is absent. Line 34 still says that "Public sample EPCIS downloads are a separate proof surface." No such download remains. The document is the canonical product description, so this capability claim is now false. Delete that sentence.Proposed fix
📝 Committable suggestion