adjust tests

This commit is contained in:
Kagami Sascha Rosylight
2023-07-08 15:40:48 +02:00
parent 7bf318ae98
commit 6087d02047
3 changed files with 14 additions and 6 deletions

View File

@@ -91,7 +91,7 @@ describe('ActivityPub', () => {
let rendererService: ApRendererService;
let resolver: MockResolver;
beforeEach(async () => {
beforeAll(async () => {
const app = await Test.createTestingModule({
imports: [GlobalModule, CoreModule],
}).compile();
@@ -109,6 +109,10 @@ describe('ActivityPub', () => {
jest.spyOn(federatedInstanceService, 'fetch').mockImplementation(() => new Promise(() => { }));
});
beforeEach(() => {
resolver.clear();
});
describe('Parse minimum object', () => {
const actor = createRandomActor();
@@ -227,8 +231,8 @@ describe('ActivityPub', () => {
await personService.createPerson(actor.id, resolver);
const items = outbox.orderedItems as ICreate[];
assert.ok(await noteService.fetchNote(items[99].object));
assert.ok(!await noteService.fetchNote(items[100].object));
assert.ok(await noteService.fetchNote(items[19].object));
assert.ok(!await noteService.fetchNote(items[20].object));
});
});
});