parent
c27e3bd72c
commit
becfdc2b7f
7 changed files with 3 additions and 126 deletions
|
@ -85,8 +85,6 @@ describe('ActivityPub', () => {
|
|||
let resolver: MockResolver;
|
||||
|
||||
const metaInitial = {
|
||||
cacheRemoteFiles: true,
|
||||
cacheRemoteSensitiveFiles: true,
|
||||
blockedHosts: [] as string[],
|
||||
sensitiveWords: [] as string[],
|
||||
} as Meta;
|
||||
|
@ -258,35 +256,6 @@ describe('ActivityPub', () => {
|
|||
|
||||
describe('Images', () => {
|
||||
test('Create images', async () => {
|
||||
const imageObject: IApDocument = {
|
||||
type: 'Document',
|
||||
mediaType: 'image/png',
|
||||
url: 'http://host1.test/foo.png',
|
||||
name: '',
|
||||
};
|
||||
const driveFile = await imageService.createImage(
|
||||
await createRandomRemoteUser(resolver, personService),
|
||||
imageObject,
|
||||
);
|
||||
assert.ok(!driveFile.isLink);
|
||||
|
||||
const sensitiveImageObject: IApDocument = {
|
||||
type: 'Document',
|
||||
mediaType: 'image/png',
|
||||
url: 'http://host1.test/bar.png',
|
||||
name: '',
|
||||
sensitive: true,
|
||||
};
|
||||
const sensitiveDriveFile = await imageService.createImage(
|
||||
await createRandomRemoteUser(resolver, personService),
|
||||
sensitiveImageObject,
|
||||
);
|
||||
assert.ok(!sensitiveDriveFile.isLink);
|
||||
});
|
||||
|
||||
test('cacheRemoteFiles=false disables caching', async () => {
|
||||
meta = { ...metaInitial, cacheRemoteFiles: false };
|
||||
|
||||
const imageObject: IApDocument = {
|
||||
type: 'Document',
|
||||
mediaType: 'image/png',
|
||||
|
@ -312,34 +281,5 @@ describe('ActivityPub', () => {
|
|||
);
|
||||
assert.ok(sensitiveDriveFile.isLink);
|
||||
});
|
||||
|
||||
test('cacheRemoteSensitiveFiles=false only affects sensitive files', async () => {
|
||||
meta = { ...metaInitial, cacheRemoteSensitiveFiles: false };
|
||||
|
||||
const imageObject: IApDocument = {
|
||||
type: 'Document',
|
||||
mediaType: 'image/png',
|
||||
url: 'http://host1.test/foo.png',
|
||||
name: '',
|
||||
};
|
||||
const driveFile = await imageService.createImage(
|
||||
await createRandomRemoteUser(resolver, personService),
|
||||
imageObject,
|
||||
);
|
||||
assert.ok(!driveFile.isLink);
|
||||
|
||||
const sensitiveImageObject: IApDocument = {
|
||||
type: 'Document',
|
||||
mediaType: 'image/png',
|
||||
url: 'http://host1.test/bar.png',
|
||||
name: '',
|
||||
sensitive: true,
|
||||
};
|
||||
const sensitiveDriveFile = await imageService.createImage(
|
||||
await createRandomRemoteUser(resolver, personService),
|
||||
sensitiveImageObject,
|
||||
);
|
||||
assert.ok(sensitiveDriveFile.isLink);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue