mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -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,
|
updatedAt: historyEntryImport.lastVisitedAt,
|
||||||
};
|
};
|
||||||
|
|
||||||
const createQueryBuilder = mockSelectQueryBuilderInRepo(noteRepo, note);
|
mockSelectQueryBuilderInRepo(noteRepo, note);
|
||||||
|
const createQueryBuilderForEntityManager = {
|
||||||
|
where: () => createQueryBuilderForEntityManager,
|
||||||
|
getMany: () => [historyEntry],
|
||||||
|
};
|
||||||
|
|
||||||
const mockedManager = Mock.of<EntityManager>({
|
const mockedManager = Mock.of<EntityManager>({
|
||||||
find: jest.fn().mockResolvedValueOnce([historyEntry]),
|
createQueryBuilder: jest.fn().mockImplementation(() => createQueryBuilderForEntityManager),
|
||||||
createQueryBuilder: () => createQueryBuilder,
|
remove: jest.fn().mockImplementationOnce(async (entry: HistoryEntry) => {
|
||||||
remove: jest.fn().mockImplementationOnce(async (_: HistoryEntry) => {
|
expect(await (await entry.note).aliases).toHaveLength(1);
|
||||||
// TODO: reimplement checks below
|
expect((await (await entry.note).aliases)[0].name).toEqual(alias);
|
||||||
//expect(await (await entry.note).aliases).toHaveLength(1);
|
expect(entry.pinStatus).toEqual(false);
|
||||||
//expect((await (await entry.note).aliases)[0].name).toEqual(alias);
|
|
||||||
//expect(entry.pinStatus).toEqual(false);
|
|
||||||
}),
|
}),
|
||||||
save: jest.fn().mockImplementationOnce(async (entry: HistoryEntry) => {
|
save: jest.fn().mockImplementationOnce(async (entry: HistoryEntry) => {
|
||||||
expect((await entry.note).aliases).toEqual(
|
expect((await entry.note).aliases).toEqual(
|
||||||
|
|
Loading…
Reference in a new issue