diff --git a/backend/test/public-api/notes.e2e-spec.ts b/backend/test/public-api/notes.e2e-spec.ts index bf43f1f40..4cf0817e9 100644 --- a/backend/test/public-api/notes.e2e-spec.ts +++ b/backend/test/public-api/notes.e2e-spec.ts @@ -130,6 +130,7 @@ describe('Notes', () => { ); await request(testSetup.app.getHttpServer()) .post('/api/v2/notes/test2') + .set('Authorization', `Bearer ${testSetup.authTokens[0].secret}`) .set('Content-Type', 'text/markdown') .send(content) .expect('Content-Type', /json/) @@ -540,7 +541,16 @@ describe('Notes', () => { .expect(200); expect(permissions.body.owner).toBe('testuser1'); expect(permissions.body.sharedToUsers).toEqual([]); - expect(permissions.body.sharedToGroups).toEqual([]); + expect(permissions.body.sharedToGroups).toEqual([ + { + groupName: '_EVERYONE', + canEdit: false, + }, + { + canEdit: true, + groupName: '_LOGGED_IN', + }, + ]); }); it('can be updated', async function () { // add permission for testuser2 @@ -561,7 +571,16 @@ describe('Notes', () => { expect(permissions.body.sharedToUsers).toEqual([ { username: 'testuser2', canEdit: true }, ]); - expect(permissions.body.sharedToGroups).toEqual([]); + expect(permissions.body.sharedToGroups).toEqual([ + { + groupName: '_EVERYONE', + canEdit: false, + }, + { + canEdit: true, + groupName: '_LOGGED_IN', + }, + ]); // add permission for everyone await request(testSetup.app.getHttpServer()) @@ -583,6 +602,10 @@ describe('Notes', () => { ]); expect(permissions.body.sharedToGroups).toEqual([ { groupName: '_EVERYONE', canEdit: true }, + { + canEdit: true, + groupName: '_LOGGED_IN', + }, ]); }); });