<commit_before>var cdb = require('cartodb.js');
cdb.admin = require('cdb.admin');
var ImportDataView = require('../../../../../../../../javascripts/cartodb/common/dialogs/create/listing/imports/import_data_view');


describe('common/dialogs/create/imports/import_data_view', function() {

  beforeEach(function() {
    
    this.user = new cdb.admin.User({
      username: 'pepe',
      base_url: 'http://pepe.cartodb.com'
    });

    this.view = new ImportDataView({
      user: this.user,
      name: 'file',
      title: 'Data file',
      options: {
        type: 'url',
        fileEnabled: true,
        acceptSync: true
      }
    });

    this.view.render();
  });

  it('should be rendered properly', function() {
    expect(this.view.$('.ImportTwitterPanel-cagetories').length).toBe(1);
    expect(this.view.$('.ImportTwitterPanel-datePicker').length).toBe(1);
    expect(this.view.$('.ImportTwitterPanel-creditsUsage').length).toBe(1);
  });

  it("should not have leaks", function() {
    expect(this.view).toHaveNoLeaks();
  });

  afterEach(function() {
    this.view.clean();
  });

});<commit_msg>Adding more specs to import data view<commit_after>var cdb = require('cartodb.js');
cdb.admin = require('cdb.admin');
var _ = require('underscore');
var ImportDataView = require('../../../../../../../../javascripts/cartodb/common/dialogs/create/listing/imports/import_data_view');


describe('common/dialogs/create/imports/import_data_view', function() {

  beforeEach(function() {
    
    this.user = new cdb.admin.User({
      username: 'pepe',
      base_url: 'http://pepe.cartodb.com'
    });

    this.view = new ImportDataView({
      user: this.user,
      name: 'file',
      title: 'Data file',
      type: 'url',
      fileEnabled: true,
      acceptSync: true
    });

    this.view.render();
  });

  it('should be rendered properly', function() {
    expect(this.view.$('.ImportPanel-header').length).toBe(1);
    expect(this.view.$('.ImportPanel-form').length).toBe(1);
    expect(this.view.$('.DatasetSelected').length).toBe(1);
    expect(_.size(this.view._subviews)).toBe(3);
  });

  describe('header view', function() {

  });

  describe('data form', function() {
    
    it('should render file input if option is enabled', function() {
      expect(this.view.$('.js-dropzone').length).toBe(1);
      this.view.options.fileEnabled = false;
      this.view.render();
      expect(this.view.$('.ImportPanel-form .Form-file').length).toBe(0);
    });

  });

  describe('selected file', function() {

  });



  it("should not have leaks", function() {
    expect(this.view).toHaveNoLeaks();
  });

  afterEach(function() {
    this.view.clean();
  });

});
{'fraction_non_alphanumeric': 0.19732441471571907, 'fraction_numerical': 0.0033444816053511705, 'mean_word_length': 3.0726172465960664, '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': '1895707', 'n_tokens_mistral': 888, 'n_tokens_neox': 848, 'n_words': 136}