<commit_before>;(function(Form, Editor) {

var same = deepEqual;


module('Editor#initialize');

test('sets the value if using options.model', function() {
  var model = new Backbone.Model({
    name: 'John'
  });

  var editor = new Editor({
    model: model,
    key: 'name'
  });

  same(editor.value, 'John');
});

test('uses options.value if options.model not specified', function() {
  var editor = new Editor({
    value: 'Hello'
  });

  same(editor.value, 'Hello');
});

test('sets to defaultValue if options.model and options.value are not set', function() {
  var editor = new Editor();

  same(editor.value, null);
});

test('stores important data', function() {
  var form = new Form(),
      schema = { type: 'Text', validators: ['required'] };

  var editor = new Editor({
    form: form,
    key: 'name',
    schema: schema
  });

  same(editor.key, 'name');<commit_msg>add test for base editor<commit_after>;(function(Form, Editor) {

var same = deepEqual;


module('Editor#initialize');

test('sets the value if using options.model', function() {
  var model = new Backbone.Model({
    name: 'John'
  });

  var editor = new Editor({
    model: model,
    key: 'name'
  });

  same(editor.value, 'John');
});

test('uses options.value if options.model not specified', function() {
  var editor = new Editor({
    value: 'Hello'
  });

  same(editor.value, 'Hello');
});

test('make sure value is not undefined if it is false', function() {
  var editor = new Editor({
    value: false
  });
  
  same(editor.value, false);
});

test('sets to defaultValue if options.model and options.value are not set', function() {
  var editor = new Editor();

  same(editor.value, null);
});

test('stores important data', function() {
  var form = new Form(),
      schema = { type: 'Text', validators: ['required'] };

  var editor = new Editor({
    form: form,
    key: 'name',
    schema: schema
  });

  same(editor.key, 'name');
{'fraction_non_alphanumeric': 0.16494845360824742, 'fraction_numerical': 0.0, 'mean_word_length': 3.5456674473067915, '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': '2432000', 'n_tokens_mistral': 617, 'n_tokens_neox': 602, 'n_words': 194}