wikibase-edit
Version:
Edit Wikibase from NodeJS
17 lines • 705 B
JavaScript
import 'should';
import { deleteEntity } from '../../../src/lib/entity/delete.js';
import { someEntityId as id } from '../utils.js';
describe('entity delete', () => {
it('should set the action to delete', () => {
deleteEntity({ id }).action.should.equal('delete');
});
it('should set the title to the entity id', () => {
deleteEntity({ id }).data.title.should.equal(id);
});
it('should reject invalid entity ids', () => {
deleteEntity.bind(null, { id: 'bla' }).should.throw();
deleteEntity.bind(null, { id: 'Item:Q1' }).should.throw();
deleteEntity.bind(null, { id: 'Property:P1' }).should.throw();
});
});
//# sourceMappingURL=delete.js.map