Skip to content

feat: insights-parser tests + EMPTY_DATA + README replace#1

Merged
heznpc merged 2 commits into
mainfrom
feat/insights-tests-and-empty-data
Apr 11, 2026
Merged

feat: insights-parser tests + EMPTY_DATA + README replace#1
heznpc merged 2 commits into
mainfrom
feat/insights-tests-and-empty-data

Conversation

@heznpc
Copy link
Copy Markdown
Member

@heznpc heznpc commented Apr 11, 2026

Summary

  • EMPTY_DATA handling: parser.ts now throws EMPTY_DATA when a zip validates as an Instagram export but every parseable record set is empty. UI surfaces a clear message via the new upload.error.EMPTY_DATA locale string. Applied to both parseInstagramZip and parseFileFull.
  • insights-parser regression guards (new): src/lib/__tests__/insights-parser.test.ts covers likedPosts / savedPosts / profileSearches / wordSearches / loginActivity / chatList with both KO and EN label fixtures. Fixtures include the extra wrapper noise IG ships so a class-name or layout change is caught before it reaches users.
  • parser.test.ts: previously-existing "empty followers_and_following directory" test flipped to assert EMPTY_DATA (matches the new behavior).
  • README.md: replace the create-next-app template with an actual product description, privacy model, tech stack, test layout, character classification table, and an "Instagram format change" playbook.

Closes P1 items in review.md: README replace, Instagram HTML parser fragility (regression guards), and empty-data fallback.

Test plan

  • npm test — all existing cases pass and the 6 new insights-parser.test.ts cases pass.
  • Upload a zip with only followers_and_following/readme.txt (no actual records) → UI shows the EMPTY_DATA copy, not a blank dashboard.
  • Upload a real IG export → insights and analysis render as before.

heznpc added 2 commits April 11, 2026 20:09
- parser.ts: surface EMPTY_DATA when the zip validates as an
  Instagram export but parseable records are all empty. The UI
  now tells the user "this looks like an IG export but the
  format may have changed" instead of rendering a blank
  dashboard. Applied to both parseInstagramZip and parseFileFull.
- parser.test.ts: the "empty followers_and_following directory"
  case flipped — it now asserts EMPTY_DATA rather than accepting
  a zero-result success.
- locales/{en,ko}.json: new EMPTY_DATA error copy, framed as a
  call to action ("request a fresh export, open an issue on
  GitHub").
- insights-parser.test.ts (new): regression guards for the
  fragile HTML parsers — likedPosts / savedPosts / profileSearches
  / wordSearches / loginActivity / chatList — with both KO and EN
  label fixtures so a class-name or locale change in Instagram's
  export is caught before hitting users. Fixtures intentionally
  ship the extra wrapper noise IG emits.
- README.md: replace the create-next-app template with an actual
  description of what followprint does, how to get the IG export,
  how to run tests, character classification table, and the
  Instagram-format-change playbook.
scripts/debug-zip.js and scripts/generate-test-data.js are local
CommonJS one-offs (never bundled into the site) and the
`@typescript-eslint/no-require-imports` rule was failing CI on
their `require()` usage. Add scripts/** to globalIgnores so the
Next lint rules only gate actual product code.
@heznpc heznpc merged commit 5e89942 into main Apr 11, 2026
1 check passed
@heznpc heznpc deleted the feat/insights-tests-and-empty-data branch April 11, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant