2021-01-05 16:12:38 -05:00
|
|
|
/*
|
2021-01-06 15:36:07 -05:00
|
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
2021-01-05 16:12:38 -05:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2020-07-26 14:57:28 -04:00
|
|
|
import { Test, TestingModule } from '@nestjs/testing';
|
2020-09-22 15:59:09 -04:00
|
|
|
import { getRepositoryToken } from '@nestjs/typeorm';
|
2020-09-27 15:48:42 -04:00
|
|
|
import { LoggerModule } from '../logger/logger.module';
|
2020-09-22 15:59:09 -04:00
|
|
|
import { AuthorColor } from '../notes/author-color.entity';
|
|
|
|
import { Note } from '../notes/note.entity';
|
|
|
|
import { NotesModule } from '../notes/notes.module';
|
2021-01-22 09:29:10 -05:00
|
|
|
import { AuthToken } from '../auth/auth-token.entity';
|
2020-09-22 15:59:09 -04:00
|
|
|
import { Identity } from '../users/identity.entity';
|
|
|
|
import { User } from '../users/user.entity';
|
|
|
|
import { Authorship } from './authorship.entity';
|
|
|
|
import { Revision } from './revision.entity';
|
2020-07-26 14:57:28 -04:00
|
|
|
import { RevisionsService } from './revisions.service';
|
2020-10-03 11:24:42 -04:00
|
|
|
import { Tag } from '../notes/tag.entity';
|
2020-07-26 14:57:28 -04:00
|
|
|
|
|
|
|
describe('RevisionsService', () => {
|
|
|
|
let service: RevisionsService;
|
|
|
|
|
|
|
|
beforeEach(async () => {
|
|
|
|
const module: TestingModule = await Test.createTestingModule({
|
2020-09-22 15:59:09 -04:00
|
|
|
providers: [
|
|
|
|
RevisionsService,
|
|
|
|
{
|
|
|
|
provide: getRepositoryToken(Revision),
|
|
|
|
useValue: {},
|
|
|
|
},
|
|
|
|
],
|
2020-09-27 15:48:42 -04:00
|
|
|
imports: [NotesModule, LoggerModule],
|
2020-09-22 15:59:09 -04:00
|
|
|
})
|
|
|
|
.overrideProvider(getRepositoryToken(Authorship))
|
|
|
|
.useValue({})
|
|
|
|
.overrideProvider(getRepositoryToken(AuthorColor))
|
|
|
|
.useValue({})
|
|
|
|
.overrideProvider(getRepositoryToken(User))
|
|
|
|
.useValue({})
|
|
|
|
.overrideProvider(getRepositoryToken(AuthToken))
|
|
|
|
.useValue({})
|
|
|
|
.overrideProvider(getRepositoryToken(Identity))
|
|
|
|
.useValue({})
|
|
|
|
.overrideProvider(getRepositoryToken(Note))
|
|
|
|
.useValue({})
|
|
|
|
.overrideProvider(getRepositoryToken(Revision))
|
|
|
|
.useValue({})
|
2020-10-03 11:24:42 -04:00
|
|
|
.overrideProvider(getRepositoryToken(Tag))
|
|
|
|
.useValue({})
|
2020-09-22 15:59:09 -04:00
|
|
|
.compile();
|
2020-07-26 14:57:28 -04:00
|
|
|
|
|
|
|
service = module.get<RevisionsService>(RevisionsService);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should be defined', () => {
|
|
|
|
expect(service).toBeDefined();
|
|
|
|
});
|
|
|
|
});
|