feat(parent structure): add method that return note parent structure #847
run-tests.yml
on: pull_request
Matrix: tests
report-coverage
0s
Annotations
5 errors and 2 warnings
src/presentation/http/router/note.test.ts > Note API > GET note/:notePublicId > Returns one parents note in case when note has one parents:
src/presentation/http/router/note.test.ts#L561
AssertionError: expected { …(5) } to match object { parents: [ { …(2) }, { …(2) } ] }
- Expected
+ Received
Object {
- "parents": 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-27T18:21:44.016Z",
+ "id": "tAC6bFn11L",
+ "updatedAt": "2024-09-27T18:21:44.016Z",
+ },
+ "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-27T18:21:44.014Z",
"id": "bTsyGp9zK8",
+ "updatedAt": "2024-09-27T18:21:44.014Z",
},
+ "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",
},
],
},
+ "createdAt": "2024-09-27T18:21:44.016Z",
"id": "tAC6bFn11L",
+ "updatedAt": "2024-09-27T18:21:44.016Z",
+ },
+ ],
+ "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:561:32
|
src/presentation/http/router/note.test.ts > Note API > GET note/:notePublicId > Returns two parents note in case when note has two parents:
src/presentation/http/router/note.test.ts#L625
AssertionError: expected { …(5) } to match object { parents: [ { …(2) }, …(2) ] }
- Expected
+ Received
Object {
- "parents": Array [
- Object {
+ "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",
},
],
},
- "id": "iRQO2Vop_v",
+ "createdAt": "2024-09-27T18:21:44.104Z",
+ "id": "5BXYX6-cwT",
+ "updatedAt": "2024-09-27T18:21:44.104Z",
},
- Object {
+ "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-27T18:21:44.102Z",
"id": "dGaubF18ey",
+ "updatedAt": "2024-09-27T18:21:44.102Z",
},
+ "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",
},
],
},
+ "createdAt": "2024-09-27T18:21:44.104Z",
"id": "5BXYX6-cwT",
+ "updatedAt": "2024-09-27T18:21:44.104Z",
+ },
+ ],
+ "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:625:32
|
src/presentation/http/router/note.test.ts > Note API > GET note/:notePublicId > Returns one parents note in case where the note is not created by the same user but share relation:
src/presentation/http/router/note.test.ts#L685
AssertionError: expected { …(5) } to match object { parents: [ { …(2) }, { …(2) } ] }
- Expected
+ Received
Object {
- "parents": 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-27T18:21:44.173Z",
+ "id": "U_6bZS-kjS",
+ "updatedAt": "2024-09-27T18:21:44.173Z",
+ },
+ "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-27T18:21:44.170Z",
"id": "NmTIkzWwbW",
+ "updatedAt": "2024-09-27T18:21:44.170Z",
},
+ "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",
},
],
},
+ "createdAt": "2024-09-27T18:21:44.173Z",
"id": "U_6bZS-kjS",
+ "updatedAt": "2024-09-27T18:21:44.173Z",
+ },
+ ],
+ "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:685: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#L727
AssertionError: expected { …(4) } to match object { parents: [ { …(2) } ] }
- Expected
+ Received
Object {
- "parents": Array [
- Object {
+ "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-27T18:21:44.244Z",
"id": "CidQO3uWDO",
+ "updatedAt": "2024-09-27T18:21:44.244Z",
+ },
+ "parents": Array [],
+ "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:727: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
|
97 KB |
|