<commit_before>describe("confirm_type_change_dialog", function() {

  var dialog, dom;
  beforeEach(function() {
    dialog = new cdb.admin.ConfirmTypeChangeDialog();
    dom = dialog.render();

  });

  describe("when rendered ", function() {
    it('should have an ok button', function() {
      expect(dom.$('.ok').length).toEqual(1);
    })
    it('should have a cancel button', function() {
      expect(dom.$('.cancel').length).toEqual(1);
    })
  })

  describe("when asking for confirmation", function() {
    var $container, confirm;

    beforeEach(function() {
      $container = $('<div></div>')
      confirm = dialog.confirm($container);
    })

    it('should return a promise', function() {
      expect(typeof confirm.then).toEqual('function')
    })

    it('should resolve positively the promise when ok button is clicked', function() {
      $container.find('.ok').click();
      expect(confirm.isResolved()).toBeTruthy();
    })

    it('should reject the promise when cancel button is clicked', function() {
      $container.find('.cancel').click();
      expect(confirm.isRejected()).toBeTruthy();
    })


  })

});<commit_msg>confirm type change test fixed<commit_after>describe("confirm_type_change_dialog", function() {

  var dialog, dom;
  beforeEach(function() {
    dialog = new cdb.admin.ConfirmTypeChangeDialog();
    dom = dialog.render();

  });

  describe("when rendered ", function() {
    it('should have an ok button', function() {
      expect(dom.$('.ok').length).toEqual(1);
    })
    it('should have a cancel button', function() {
      expect(dom.$('.cancel').length).toEqual(1);
    })
  })

  describe("when asking for confirmation", function() {
    var $container, confirm;

    beforeEach(function() {
      $container = $('body')
      confirm = dialog.confirm($container);
    })

    afterEach(function() {
      $('.confirmTypeChangeDialog').remove();
    })

    it('should return a promise', function() {
      expect(typeof confirm.then).toEqual('function')
    })

    it('should resolve positively the promise when ok button is clicked', function() {
      $container.find('.ok').click();
      expect(confirm.isResolved()).toBeTruthy();
    })

    it('should reject the promise when cancel button is clicked', function() {
      $container.find('.cancel').click();
      expect(confirm.isRejected()).toBeTruthy();
    })


  })

});
{'fraction_non_alphanumeric': 0.1707724425887265, 'fraction_numerical': 0.0016701461377870565, 'mean_word_length': 3.380255941499086, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4442640', 'n_tokens_mistral': 685, 'n_tokens_neox': 662, 'n_words': 152}