The Open Source kanban (built with Meteor). Keep variable/table/field names camelCase. For translations, only add Pull Request changes to wekan/i18n/en.i18n.json , other translations are done at https://transifex.com/wekan/wekan only.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
wekan/server/lib/tests/attachmentDeleteActor.tests.js

24 lines
1017 B

/* eslint-env mocha */
import { expect } from 'chai';
import { deleteActivityUserId } from '../attachmentActivityActor';
// Bug #5504: the 'deleteAttachment' activity must credit the user who actually
// deleted the attachment (the acting user), not the original uploader.
describe('attachmentActivityActor.deleteActivityUserId', function() {
it('credits the acting user when an acting user is present', function() {
const actingUserId = 'acting-user-deleter';
const uploaderUserId = 'uploader-person-a';
expect(deleteActivityUserId(actingUserId, uploaderUserId)).to.equal(
actingUserId,
);
});
it('falls back to the uploader when there is no acting user', function() {
const uploaderUserId = 'uploader-person-a';
expect(deleteActivityUserId(null, uploaderUserId)).to.equal(uploaderUserId);
expect(deleteActivityUserId(undefined, uploaderUserId)).to.equal(
uploaderUserId,
);
expect(deleteActivityUserId('', uploaderUserId)).to.equal(uploaderUserId);
});
});