-
Notifications
You must be signed in to change notification settings - Fork 15
[♻] {PROD4POD-1931} Move zipfile mock-up and improve coverage #1205
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
Merged
The head ref may contain hidden characters: "\u267B-move-zipfile-mock-up"
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
419eb10
:recycle: Moving files and changing paths, part 1
9934230
Moved encoding test too
301be4e
Boosts coverage :white_check_mark:
149b5d7
:recycle: eliminates unneeded variable
e399dee
Test missing file names
3b566e4
:bug: use real file
d807ba4
:white_check_mark: except for rendering
72dac96
:rotating_light:
31e6e5b
Test anonymized message thread id
6e66eb1
Merge branch 'main' into ♻-move-zipfile-mock-up
daad451
Address comments
ddd17cc
Rather heavy refactoring requested in comments :recycle: DRY
10ff9a8
Merge branch 'main' into ♻-move-zipfile-mock-up
6245117
:recycle: additional refactoring analysis to a common function
4b09b67
Add additional test for status successful :white_check_mark:
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
2 changes: 1 addition & 1 deletion
2
...facebookImport/test/mocks/zipfile-mock.js → ...e-utils/poly-import/utils/zipfile-mock.js
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
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
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
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
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
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
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
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
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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
features/facebookImport/test/importers/personal-data-importer.test.js
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
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
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
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
2 changes: 1 addition & 1 deletion
2
features/facebookImport/test/importers/test-definition/importer-tests-definition.js
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
2 changes: 1 addition & 1 deletion
2
features/facebookImport/test/ministory/about-pictures-data-analysis.test.js
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
72 changes: 72 additions & 0 deletions
72
features/facebookImport/test/ministory/json-file-names-analysis.test.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| import JSONFileNamesAnalysis from "../../src/model/analyses/report/json-file-names-analysis"; | ||
| import commonStructure from "../../src/static/commonStructure"; | ||
| import { ZipFileMock } from "@polypoly-eu/poly-import"; | ||
| import { runAnalysisForExport } from "../utils/analyses-execution"; | ||
| import { expectAnalysisSuccessStatus } from "../utils/analysis-assertions"; | ||
|
|
||
| const commonJsonFiles = commonStructure | ||
| .filter((path) => path.match(/\.json$/)) | ||
| .map((jsonPath) => { | ||
| return jsonPath.substring(1); | ||
| }); | ||
|
|
||
| async function analyzeZipWithFiles(files) { | ||
| const zipFile = new ZipFileMock(); | ||
| if (files.length > 0) { | ||
| files.forEach((jsonPath) => { | ||
| zipFile.addJsonEntry(jsonPath, { foo: "bar" }); | ||
| }); | ||
| } | ||
| const { analysisResult } = await runAnalysisForExport( | ||
| JSONFileNamesAnalysis, | ||
| zipFile | ||
| ); | ||
| return analysisResult; | ||
| } | ||
|
|
||
| describe("JSON files analysis for empty zip", () => { | ||
| let status; | ||
| beforeAll(async () => { | ||
| ({ status } = await analyzeZipWithFiles([])); | ||
| }); | ||
| it("has success status", async () => { | ||
| expectAnalysisSuccessStatus(status); | ||
| }); | ||
| }); | ||
|
|
||
| describe("JSON files analysis for non-empty zip", () => { | ||
| let status; | ||
| let analysis; | ||
|
|
||
| beforeAll(async () => { | ||
| ({ status, analysis } = await analyzeZipWithFiles(commonJsonFiles)); | ||
| }); | ||
|
|
||
| it("reports successful status", () => { | ||
| expect(status.isSuccess).toBe(true); | ||
| }); | ||
|
|
||
| it("has the right name", () => { | ||
| expect(analysis.reportData).toStrictEqual(commonJsonFiles); | ||
| }); | ||
|
|
||
| it("has the right title", () => { | ||
| expect(analysis.title).toBe("JSON file names"); | ||
| }); | ||
| }); | ||
|
|
||
| describe("JSON files analysis with anonymized path", () => { | ||
| let analysis; | ||
| beforeAll(async () => { | ||
| commonJsonFiles.push( | ||
| "messages/archived_threads/facebookuser_gktxomrifg/message_1.json" | ||
| ); | ||
| ({ analysis } = await analyzeZipWithFiles(commonJsonFiles)); | ||
| }); | ||
|
|
||
| it("has anonymized file", () => { | ||
| expect(analysis.reportData).toContain( | ||
| "messages/archived_threads/uniqueid_hash/message_1.json" | ||
| ); | ||
| }); | ||
| }); | ||
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
2 changes: 1 addition & 1 deletion
2
features/facebookImport/test/ministory/missing-common-json-files.test.js
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
2 changes: 1 addition & 1 deletion
2
features/facebookImport/test/ministory/post-reactions-types-analysis.test.js
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.