mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05:00
test: complete todo
Signed-off-by: yamashush <38120991+yamashush@users.noreply.github.com>
This commit is contained in:
parent
662de1e9f8
commit
1c22a425bd
1 changed files with 11 additions and 8 deletions
|
@ -393,15 +393,18 @@ describe('HistoryService', () => {
|
|||
updatedAt: historyEntryImport.lastVisitedAt,
|
||||
};
|
||||
|
||||
const createQueryBuilder = mockSelectQueryBuilderInRepo(noteRepo, note);
|
||||
mockSelectQueryBuilderInRepo(noteRepo, note);
|
||||
const createQueryBuilderForEntityManager = {
|
||||
where: () => createQueryBuilderForEntityManager,
|
||||
getMany: () => [historyEntry],
|
||||
};
|
||||
|
||||
const mockedManager = Mock.of<EntityManager>({
|
||||
find: jest.fn().mockResolvedValueOnce([historyEntry]),
|
||||
createQueryBuilder: () => createQueryBuilder,
|
||||
remove: jest.fn().mockImplementationOnce(async (_: HistoryEntry) => {
|
||||
// TODO: reimplement checks below
|
||||
//expect(await (await entry.note).aliases).toHaveLength(1);
|
||||
//expect((await (await entry.note).aliases)[0].name).toEqual(alias);
|
||||
//expect(entry.pinStatus).toEqual(false);
|
||||
createQueryBuilder: jest.fn().mockImplementation(() => createQueryBuilderForEntityManager),
|
||||
remove: jest.fn().mockImplementationOnce(async (entry: HistoryEntry) => {
|
||||
expect(await (await entry.note).aliases).toHaveLength(1);
|
||||
expect((await (await entry.note).aliases)[0].name).toEqual(alias);
|
||||
expect(entry.pinStatus).toEqual(false);
|
||||
}),
|
||||
save: jest.fn().mockImplementationOnce(async (entry: HistoryEntry) => {
|
||||
expect((await entry.note).aliases).toEqual(
|
||||
|
|
Loading…
Reference in a new issue