wip: add test
This commit is contained in:
parent
9bb6ce4451
commit
0522520fdd
|
@ -595,7 +595,7 @@ export class ApRendererService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public renderNoteUpdate(object: IObject, note: MiNote, user: { id: MiUser['id'] }): IUpdate {
|
public renderNoteUpdate(object: IPost, note: MiNote, user: { id: MiUser['id'] }): IUpdate {
|
||||||
const activity: IUpdate = {
|
const activity: IUpdate = {
|
||||||
id: `${this.config.url}/users/${user.id}#updates/${new Date().getTime()}`,
|
id: `${this.config.url}/users/${user.id}#updates/${new Date().getTime()}`,
|
||||||
actor: this.userEntityService.genLocalUserUri(note.userId),
|
actor: this.userEntityService.genLocalUserUri(note.userId),
|
||||||
|
|
|
@ -386,6 +386,25 @@ describe('ActivityPub', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Update', async () => {
|
||||||
|
const actor = createRandomActor();
|
||||||
|
|
||||||
|
const post = {
|
||||||
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
|
id: `${host}/users/${secureRndstr(8)}`,
|
||||||
|
type: 'Note',
|
||||||
|
attributedTo: actor.id,
|
||||||
|
to: 'https://www.w3.org/ns/activitystreams#Public',
|
||||||
|
content: 'あ',
|
||||||
|
};
|
||||||
|
|
||||||
|
const note = await noteService.createNote(post.id, resolver, true);
|
||||||
|
|
||||||
|
test('Update note', async () => {
|
||||||
|
rendererService.renderNoteUpdate(await rendererService.renderNote(note!, false, true), note!, actor);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('JSON-LD', () =>{
|
describe('JSON-LD', () =>{
|
||||||
test('Compaction', async () => {
|
test('Compaction', async () => {
|
||||||
const jsonLd = jsonLdService.use();
|
const jsonLd = jsonLdService.use();
|
||||||
|
|
Loading…
Reference in New Issue