feat: insights-parser tests + EMPTY_DATA + README replace#1
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parser.tsnow throwsEMPTY_DATAwhen a zip validates as an Instagram export but every parseable record set is empty. UI surfaces a clear message via the newupload.error.EMPTY_DATAlocale string. Applied to bothparseInstagramZipandparseFileFull.src/lib/__tests__/insights-parser.test.tscoverslikedPosts/savedPosts/profileSearches/wordSearches/loginActivity/chatListwith 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.EMPTY_DATA(matches the new behavior).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 newinsights-parser.test.tscases pass.followers_and_following/readme.txt(no actual records) → UI shows the EMPTY_DATA copy, not a blank dashboard.