mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-26 11:43:59 -05:00
Tests: Fix GET /me e2e test
Since the /me route does work now, we should reactivate (and fix) this test, too. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
07dc15b127
commit
5edf5f1676
1 changed files with 6 additions and 7 deletions
|
@ -7,7 +7,6 @@
|
||||||
import { INestApplication } from '@nestjs/common';
|
import { INestApplication } from '@nestjs/common';
|
||||||
import { Test } from '@nestjs/testing';
|
import { Test } from '@nestjs/testing';
|
||||||
import * as request from 'supertest';
|
import * as request from 'supertest';
|
||||||
import { UserInfoDto } from '../../src/users/user-info.dto';
|
|
||||||
import { HistoryService } from '../../src/history/history.service';
|
import { HistoryService } from '../../src/history/history.service';
|
||||||
import { NotesService } from '../../src/notes/notes.service';
|
import { NotesService } from '../../src/notes/notes.service';
|
||||||
import { HistoryEntryUpdateDto } from '../../src/history/history-entry-update.dto';
|
import { HistoryEntryUpdateDto } from '../../src/history/history-entry-update.dto';
|
||||||
|
@ -35,6 +34,7 @@ describe('Notes', () => {
|
||||||
let app: INestApplication;
|
let app: INestApplication;
|
||||||
let historyService: HistoryService;
|
let historyService: HistoryService;
|
||||||
let notesService: NotesService;
|
let notesService: NotesService;
|
||||||
|
let userService: UsersService;
|
||||||
let user: User;
|
let user: User;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
|
@ -67,19 +67,18 @@ describe('Notes', () => {
|
||||||
app = moduleRef.createNestApplication();
|
app = moduleRef.createNestApplication();
|
||||||
notesService = moduleRef.get(NotesService);
|
notesService = moduleRef.get(NotesService);
|
||||||
historyService = moduleRef.get(HistoryService);
|
historyService = moduleRef.get(HistoryService);
|
||||||
const userService = moduleRef.get(UsersService);
|
userService = moduleRef.get(UsersService);
|
||||||
user = await userService.createUser('hardcoded', 'Testy');
|
user = await userService.createUser('hardcoded', 'Testy');
|
||||||
await app.init();
|
await app.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip(`GET /me`, async () => {
|
it(`GET /me`, async () => {
|
||||||
// TODO Get user from beforeAll
|
const userInfo = userService.toUserDto(user);
|
||||||
const userInfo = new UserInfoDto();
|
|
||||||
const response = await request(app.getHttpServer())
|
const response = await request(app.getHttpServer())
|
||||||
.post('/me')
|
.get('/me')
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
.expect(200);
|
.expect(200);
|
||||||
expect(response.body.content).toEqual(userInfo);
|
expect(response.body).toEqual(userInfo);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`GET /me/history`, async () => {
|
it(`GET /me/history`, async () => {
|
||||||
|
|
Loading…
Reference in a new issue