fix(backend): format code

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-08-15 21:29:40 +02:00 committed by renovate[bot]
parent 1d31a1b11f
commit 0111f2b65e
4 changed files with 16 additions and 24 deletions

View file

@ -122,9 +122,8 @@ describe('History', () => {
let postEntryDto: HistoryEntryImportDto; let postEntryDto: HistoryEntryImportDto;
let prevEntry: HistoryEntry; let prevEntry: HistoryEntry;
beforeAll(async () => { beforeAll(async () => {
const previousHistory = await testSetup.historyService.getEntriesByUser( const previousHistory =
user, await testSetup.historyService.getEntriesByUser(user);
);
expect(previousHistory).toHaveLength(1); expect(previousHistory).toHaveLength(1);
prevEntry = previousHistory[0]; prevEntry = previousHistory[0];
pinStatus = !previousHistory[0].pinStatus; pinStatus = !previousHistory[0].pinStatus;
@ -159,9 +158,8 @@ describe('History', () => {
.expect(404); .expect(404);
}); });
afterEach(async () => { afterEach(async () => {
const historyEntries = await testSetup.historyService.getEntriesByUser( const historyEntries =
user, await testSetup.historyService.getEntriesByUser(user);
);
expect(historyEntries).toHaveLength(1); expect(historyEntries).toHaveLength(1);
expect(await (await historyEntries[0].note).aliases).toEqual( expect(await (await historyEntries[0].note).aliases).toEqual(
await ( await (

View file

@ -127,9 +127,8 @@ describe('Me', () => {
await expect( await expect(
testSetup.userService.getUserByUsername('hardcoded'), testSetup.userService.getUserByUsername('hardcoded'),
).rejects.toThrow(NotInDBError); ).rejects.toThrow(NotInDBError);
const mediaUploadsAfter = await testSetup.mediaService.listUploadsByNote( const mediaUploadsAfter =
note1, await testSetup.mediaService.listUploadsByNote(note1);
);
expect(mediaUploadsAfter).toHaveLength(0); expect(mediaUploadsAfter).toHaveLength(0);
}); });
}); });

View file

@ -485,9 +485,8 @@ describe('Notes', () => {
}); });
it("doesn't do anything if the user is the owner", async () => { it("doesn't do anything if the user is the owner", async () => {
const note = await testSetup.notesService.getNoteByIdOrAlias( const note =
user1NoteAlias, await testSetup.notesService.getNoteByIdOrAlias(user1NoteAlias);
);
await testSetup.permissionsService.removeUserPermission(note, user2); await testSetup.permissionsService.removeUserPermission(note, user2);
const response = await agent const response = await agent
@ -533,9 +532,8 @@ describe('Notes', () => {
}); });
it('works', async () => { it('works', async () => {
const note = await testSetup.notesService.getNoteByIdOrAlias( const note =
user1NoteAlias, await testSetup.notesService.getNoteByIdOrAlias(user1NoteAlias);
);
await testSetup.permissionsService.setUserPermission( await testSetup.permissionsService.setUserPermission(
note, note,
user2, user2,
@ -607,9 +605,8 @@ describe('Notes', () => {
}); });
it('works', async () => { it('works', async () => {
const note = await testSetup.notesService.getNoteByIdOrAlias( const note =
user1NoteAlias, await testSetup.notesService.getNoteByIdOrAlias(user1NoteAlias);
);
await testSetup.permissionsService.setGroupPermission( await testSetup.permissionsService.setGroupPermission(
note, note,
group1, group1,

View file

@ -56,9 +56,8 @@ describe('Me', () => {
.expect(200); .expect(200);
const history: HistoryEntryDto[] = response.body; const history: HistoryEntryDto[] = response.body;
expect(history.length).toEqual(1); expect(history.length).toEqual(1);
const historyDto = await testSetup.historyService.toHistoryEntryDto( const historyDto =
createdHistoryEntry, await testSetup.historyService.toHistoryEntryDto(createdHistoryEntry);
);
for (const historyEntry of history) { for (const historyEntry of history) {
expect(historyEntry.identifier).toEqual(historyDto.identifier); expect(historyEntry.identifier).toEqual(historyDto.identifier);
expect(historyEntry.title).toEqual(historyDto.title); expect(historyEntry.title).toEqual(historyDto.title);
@ -81,9 +80,8 @@ describe('Me', () => {
.expect('Content-Type', /json/) .expect('Content-Type', /json/)
.expect(200); .expect(200);
const historyEntry: HistoryEntryDto = response.body; const historyEntry: HistoryEntryDto = response.body;
const historyEntryDto = await testSetup.historyService.toHistoryEntryDto( const historyEntryDto =
createdHistoryEntry, await testSetup.historyService.toHistoryEntryDto(createdHistoryEntry);
);
expect(historyEntry.identifier).toEqual(historyEntryDto.identifier); expect(historyEntry.identifier).toEqual(historyEntryDto.identifier);
expect(historyEntry.title).toEqual(historyEntryDto.title); expect(historyEntry.title).toEqual(historyEntryDto.title);
expect(historyEntry.tags).toEqual(historyEntryDto.tags); expect(historyEntry.tags).toEqual(historyEntryDto.tags);