<commit_before><commit_msg>Add unit test for AddTag widget.<commit_after>
define(
[
    'chai',
    'sinon',
    'fixtures',
    'argumenta/widgets/AddTag',
    'argumenta/widgets/Base'
],
function(chai, undefined, fixtures, AddTag, Base) {

    var assert = chai.assert;

    // Tests

    describe('AddTag', function() {

        it('should be a function', function() {
            assert.isFunction(AddTag);
        });

        it('should include a moduleID', function() {
            assert.equal(AddTag.prototype.moduleID, 'AddTag');
        });

        describe('new AddTag( options, element )', function() {

            it('should return a new AddTag widget', function() {
                var target = fixtures.validPropositionData();
                var opts = {
                    tag_type:   'support',
                    target_type: target.target_type,
                    target_sha1: target.target_sha1
                };
                var addTag = new AddTag(opts);
                assert.instanceOf(
                    addTag, Base,
                    'AddTag widgets inherit from Base.'
                );
                assert.instanceOf(
                    addTag, AddTag,
                    'AddTag widgets are instances of AddTag.'
                );
            });
        });
    });
});
{'fraction_non_alphanumeric': 0.11337868480725624, 'fraction_numerical': 0.0015117157974300832, 'mean_word_length': 1.4887218045112782, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '83283', 'n_tokens_mistral': 362, 'n_tokens_neox': 335, 'n_words': 80}