feat(parent structure): add method that return note parent structure #835
run-tests.yml
on: pull_request
Matrix: tests
report-coverage
0s
Annotations
4 errors and 2 warnings
src/presentation/http/router/note.test.ts > Note API > GET note/:notePublicId > Returns one object of note parent structure by note public id with 200 status:
src/presentation/http/router/note.test.ts#L555
AssertionError: expected { …(4) } to match object { parentStructure: [ { …(2) } ] }
- 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-08T16:42:37.826Z",
+ "id": "lfov8VsJC7",
+ "updatedAt": "2024-09-08T16:42:37.826Z",
+ },
+ "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",
},
],
},
- "noteId": "w1z9hd4Mhp",
+ "createdAt": "2024-09-08T16:42:37.823Z",
+ "id": "w1z9hd4Mhp",
+ "updatedAt": "2024-09-08T16:42:37.823Z",
+ },
+ "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:555:32
|
src/presentation/http/router/note.test.ts > Note API > GET note/:notePublicId > Returns multiple objects of note parent structure by note public id with 200 status:
src/presentation/http/router/note.test.ts#L608
AssertionError: expected { …(4) } to match object { parentStructure: [ { …(2) }, …(1) ] }
- Expected
+ Received
Object {
- "parentStructure": Array [
- Object {
+ "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",
},
],
},
- "noteId": "7gnY08ku_7",
+ "createdAt": "2024-09-08T16:42:37.912Z",
+ "id": "Ji05hOlGjY",
+ "updatedAt": "2024-09-08T16:42:37.912Z",
},
- 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",
},
],
},
- "noteId": "1yiKr8U5js",
+ "createdAt": "2024-09-08T16:42:37.910Z",
+ "id": "7gnY08ku_7",
+ "updatedAt": "2024-09-08T16:42:37.910Z",
+ },
+ "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:608:32
|
src/presentation/http/router/note.test.ts > Note API > GET note/:notePublicId > Returns empty array of note parent structure by note public id with 200 status:
src/presentation/http/router/note.test.ts#L644
AssertionError: expected { …(3) } to match object { parentStructure: [] }
- 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-08T16:42:37.991Z",
+ "id": "wssuSRaJJt",
+ "updatedAt": "2024-09-08T16:42:37.991Z",
+ },
+ "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:644:32
|
tests (feat/return-note)
Process completed with exit code 1.
|
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/
|
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/
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
coverage-main
Expired
|
97 KB |
|