Skip to content

feat(parent structure): add method that return note parent structure #845

feat(parent structure): add method that return note parent structure

feat(parent structure): add method that return note parent structure #845

Triggered via pull request September 26, 2024 12:17
Status Failure
Total duration 2m 39s
Artifacts 1

run-tests.yml

on: pull_request
Matrix: tests
report-coverage
0s
report-coverage
Fit to window
Zoom out
Zoom in

Annotations

5 errors and 2 warnings
src/presentation/http/router/note.test.ts > Note API > GET note/:notePublicId > Returns two parents note in case of relation between child and parent note with status 200: src/presentation/http/router/note.test.ts#L607
AssertionError: expected { …(5) } to match object { parentStructure: [ { …(2) }, …(1) ] } - Expected + Received Object { - "parentStructure": Array [ + "accessRights": Object { + "canEdit": true, + }, + "note": Object { + "content": Object { + "blocks": Array [ + Object { + "data": Object { + "text": "text", + }, + "id": "mJDq8YbvqO", + "type": "paragraph", + }, + Object { + "data": Object { + "level": 2, + "text": "fdgsfdgfdsg", + }, + "id": "DeL0QehzGe", + "type": "header", + }, + ], + }, + "createdAt": "2024-09-26T12:19:16.439Z", + "id": "AdyB63HWxT", + "updatedAt": "2024-09-26T12:19:16.439Z", + }, + "parentNote": Object { + "content": Object { + "blocks": Array [ + Object { + "data": Object { + "text": "text", + }, + "id": "mJDq8YbvqO", + "type": "paragraph", + }, + Object { + "data": Object { + "level": 2, + "text": "fdgsfdgfdsg", + }, + "id": "DeL0QehzGe", + "type": "header", + }, + ], + }, + "createdAt": "2024-09-26T12:19:16.436Z", + "id": "FpbfM0pxyW", + "updatedAt": "2024-09-26T12:19:16.436Z", + }, + "parents": Array [ Object { "content": Object { "blocks": Array [ Object { "data": Object { "text": "text", }, "id": "mJDq8YbvqO", "type": "paragraph", }, Object { "data": Object { "level": 2, "text": "fdgsfdgfdsg", }, "id": "DeL0QehzGe", "type": "header", }, ], }, - "noteId": "FpbfM0pxyW", + "createdAt": "2024-09-26T12:19:16.436Z", + "id": "FpbfM0pxyW", + "updatedAt": "2024-09-26T12:19:16.436Z", }, Object { "content": Object { "blocks": Array [ Object { "data": Object { "text": "text", }, "id": "mJDq8YbvqO", "type": "paragraph", }, Object { "data": Object { "level": 2, "text": "fdgsfdgfdsg", }, "id": "DeL0QehzGe", "type": "header", }, ], }, - "noteId": "AdyB63HWxT", + "createdAt": "2024-09-26T12:19:16.439Z", + "id": "AdyB63HWxT", + "updatedAt": "2024-09-26T12:19:16.439Z", + }, + ], + "tools": Array [ + Object { + "exportName": "Header", + "id": "1", + "isDefault": true, + "name": "header", + "source": Object { + "cdn": "https://cdn.jsdelivr.net/npm/@editorjs/[email protected]/dist/header.umd.min.js", + }, + "title": "Heading", + "userId": null, + }, + Object { + "exportName": "Paragraph", + "id": "2", + "isDefault": true, + "name": "paragraph", + "source": Object { + "cdn": "https://cdn.jsdelivr.net/npm/@editorjs/[email protected]/dist/paragraph.umd.min.js", + }, + "title": "Paragraph", + "userId": null, }, ], } ❯ src/presentation/http/router/note.test.ts:607:32
src/presentation/http/router/note.test.ts > Note API > GET note/:notePublicId > Returns three parents note in case of relation between all notes with status 200: src/presentation/http/router/note.test.ts#L671
AssertionError: expected { …(5) } to match object { parentStructure: [ { …(2) }, …(2) ] } - Expected + Received Object { - "parentStructure": Array [ + "accessRights": Object { + "canEdit": true, + }, + "note": Object { + "content": Object { + "blocks": Array [ + Object { + "data": Object { + "text": "text", + }, + "id": "mJDq8YbvqO", + "type": "paragraph", + }, + Object { + "data": Object { + "level": 2, + "text": "fdgsfdgfdsg", + }, + "id": "DeL0QehzGe", + "type": "header", + }, + ], + }, + "createdAt": "2024-09-26T12:19:16.534Z", + "id": "bQ8hapeC_X", + "updatedAt": "2024-09-26T12:19:16.534Z", + }, + "parentNote": Object { + "content": Object { + "blocks": Array [ + Object { + "data": Object { + "text": "text", + }, + "id": "mJDq8YbvqO", + "type": "paragraph", + }, + Object { + "data": Object { + "level": 2, + "text": "fdgsfdgfdsg", + }, + "id": "DeL0QehzGe", + "type": "header", + }, + ], + }, + "createdAt": "2024-09-26T12:19:16.531Z", + "id": "vmPsQaE3sk", + "updatedAt": "2024-09-26T12:19:16.531Z", + }, + "parents": Array [ Object { "content": Object { "blocks": Array [ Object { "data": Object { "text": "text", }, "id": "mJDq8YbvqO", "type": "paragraph", }, Object { "data": Object { "level": 2, "text": "fdgsfdgfdsg", }, "id": "DeL0QehzGe", "type": "header", }, ], }, - "noteId": "wA_fqkz_sV", + "createdAt": "2024-09-26T12:19:16.529Z", + "id": "wA_fqkz_sV", + "updatedAt": "2024-09-26T12:19:16.529Z", }, Object { "content": Object { "blocks": Array [ Object { "data": Object { "text": "text", }, "id": "mJDq8YbvqO", "type": "paragraph", }, Object { "data": Object { "level": 2, "text": "fdgsfdgfdsg", }, "id": "DeL0QehzGe", "type": "header", }, ], }, - "noteId": "vmPsQaE3sk", + "createdAt": "2024-09-26T12:19:16.531Z", + "id": "vmPsQaE3sk", + "updatedAt": "2024-09-26T12:19:16.531Z", }, Object { "content": Object { "blocks": Array [ Object { "data": Object { "text": "text", }, "id": "mJDq8YbvqO", "type": "paragraph", }, Object { "data": Object { "level": 2, "text": "fdgsfdgfdsg", }, "id": "DeL0QehzGe", "type": "header", }, ], }, - "noteId": "bQ8hapeC_X", + "createdAt": "2024-09-26T12:19:16.534Z", + "id": "bQ8hapeC_X", + "updatedAt": "2024-09-26T12:19:16.534Z", + }, + ], + "tools": Array [ + Object { + "exportName": "Header", + "id": "1", + "isDefault": true, + "name": "header", + "source": Object { + "cdn": "https://cdn.jsdelivr.net/npm/@editorjs/[email protected]/dist/header.umd.min.js", + }, + "title": "Heading", + "userId": null, + }, + Object { + "exportName": "Paragraph", + "id": "2", + "isDefault": true, + "name": "paragraph", + "source": Object { + "cdn": "https://cdn.jsdelivr.net/npm/@editorjs/[email protected]/dist/paragraph.umd.min.js", + }, + "title": "Paragraph", + "userId": null, }, ],
src/presentation/http/router/note.test.ts > Note API > GET note/:notePublicId > Returns two parents note in case where the note is not created by the same user but share relation with status 200: src/presentation/http/router/note.test.ts#L731
AssertionError: expected { …(5) } to match object { parentStructure: [ { …(2) }, …(1) ] } - Expected + Received Object { - "parentStructure": Array [ + "accessRights": Object { + "canEdit": false, + }, + "note": Object { + "content": Object { + "blocks": Array [ + Object { + "data": Object { + "text": "text", + }, + "id": "mJDq8YbvqO", + "type": "paragraph", + }, + Object { + "data": Object { + "level": 2, + "text": "fdgsfdgfdsg", + }, + "id": "DeL0QehzGe", + "type": "header", + }, + ], + }, + "createdAt": "2024-09-26T12:19:16.617Z", + "id": "Fsk0hmc64V", + "updatedAt": "2024-09-26T12:19:16.617Z", + }, + "parentNote": Object { + "content": Object { + "blocks": Array [ + Object { + "data": Object { + "text": "text", + }, + "id": "mJDq8YbvqO", + "type": "paragraph", + }, + Object { + "data": Object { + "level": 2, + "text": "fdgsfdgfdsg", + }, + "id": "DeL0QehzGe", + "type": "header", + }, + ], + }, + "createdAt": "2024-09-26T12:19:16.614Z", + "id": "CyKc5v-Ilj", + "updatedAt": "2024-09-26T12:19:16.614Z", + }, + "parents": Array [ Object { "content": Object { "blocks": Array [ Object { "data": Object { "text": "text", }, "id": "mJDq8YbvqO", "type": "paragraph", }, Object { "data": Object { "level": 2, "text": "fdgsfdgfdsg", }, "id": "DeL0QehzGe", "type": "header", }, ], }, - "noteId": "CyKc5v-Ilj", + "createdAt": "2024-09-26T12:19:16.614Z", + "id": "CyKc5v-Ilj", + "updatedAt": "2024-09-26T12:19:16.614Z", }, Object { "content": Object { "blocks": Array [ Object { "data": Object { "text": "text", }, "id": "mJDq8YbvqO", "type": "paragraph", }, Object { "data": Object { "level": 2, "text": "fdgsfdgfdsg", }, "id": "DeL0QehzGe", "type": "header", }, ], }, - "noteId": "Fsk0hmc64V", + "createdAt": "2024-09-26T12:19:16.617Z", + "id": "Fsk0hmc64V", + "updatedAt": "2024-09-26T12:19:16.617Z", + }, + ], + "tools": Array [ + Object { + "exportName": "Header", + "id": "1", + "isDefault": true, + "name": "header", + "source": Object { + "cdn": "https://cdn.jsdelivr.net/npm/@editorjs/[email protected]/dist/header.umd.min.js", + }, + "title": "Heading", + "userId": null, + }, + Object { + "exportName": "Paragraph", + "id": "2", + "isDefault": true, + "name": "paragraph", + "source": Object { + "cdn": "https://cdn.jsdelivr.net/npm/@editorjs/[email protected]/dist/paragraph.umd.min.js", + }, + "title": "Paragraph", + "userId": null, }, ], } ❯ src/presentation/http/router/note.test.ts:731:32
src/presentation/http/router/note.test.ts > Note API > GET note/:notePublicId > Returns one note in case where there is no relation exist for the note with status 200: src/presentation/http/router/note.test.ts#L773
AssertionError: expected { …(4) } to match object { parentStructure: [ { …(2) } ] } - Expected + Received Object { - "parentStructure": Array [ + "accessRights": Object { + "canEdit": true, + }, + "note": Object { + "content": Object { + "blocks": Array [ + Object { + "data": Object { + "text": "text", + }, + "id": "mJDq8YbvqO", + "type": "paragraph", + }, Object { + "data": Object { + "level": 2, + "text": "fdgsfdgfdsg", + }, + "id": "DeL0QehzGe", + "type": "header", + }, + ], + }, + "createdAt": "2024-09-26T12:19:16.689Z", + "id": "iEeYP42ftb", + "updatedAt": "2024-09-26T12:19:16.689Z", + }, + "parents": Array [ + Object { "content": Object { "blocks": Array [ Object { "data": Object { "text": "text", }, "id": "mJDq8YbvqO", "type": "paragraph", }, Object { "data": Object { "level": 2, "text": "fdgsfdgfdsg", }, "id": "DeL0QehzGe", "type": "header", }, ], }, - "noteId": "iEeYP42ftb", + "createdAt": "2024-09-26T12:19:16.689Z", + "id": "iEeYP42ftb", + "updatedAt": "2024-09-26T12:19:16.689Z", + }, + ], + "tools": Array [ + Object { + "exportName": "Header", + "id": "1", + "isDefault": true, + "name": "header", + "source": Object { + "cdn": "https://cdn.jsdelivr.net/npm/@editorjs/[email protected]/dist/header.umd.min.js", + }, + "title": "Heading", + "userId": null, + }, + Object { + "exportName": "Paragraph", + "id": "2", + "isDefault": true, + "name": "paragraph", + "source": Object { + "cdn": "https://cdn.jsdelivr.net/npm/@editorjs/[email protected]/dist/paragraph.umd.min.js", + }, + "title": "Paragraph", + "userId": null, }, ], } ❯ src/presentation/http/router/note.test.ts:773:32
tests (feat/return-note)
Process completed with exit code 1.
tests (main)
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/setup-node@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
tests (feat/return-note)
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/setup-node@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/

Artifacts

Produced during runtime
Name Size
coverage-main Expired
97 KB