<commit_before>describe('$mdDialog', function() {
  
  beforeEach(TestUtil.mockRaf);
  beforeEach(module('material.components.dialog', 'ngAnimateMock'));

  beforeEach(inject(function spyOnMdEffects($mdEffects, $$q, $animate) {
    spyOn($mdEffects, 'popIn').andCallFake(function(element, parent, targetEvent) {
      parent.append(element);
      return $$q.when();
    });
    spyOn($animate, 'leave').andCallFake(function(element) {
      element.remove();
      return $$q.when();
    });

    spyOn($animate, 'enter').andCallFake(function(element, parent) {
      parent.append(element);
      return $$q.when();
    });
  }));

  it('should support onComplete callbacks within `show()`', inject(function($mdDialog, $rootScope, $timeout) {

    var template = '<md-dialog>Hello</md-dialog>';
    var parent = angular.element('<div>');
    var ready = false;

    $mdDialog.show({
      template: template,
      parent: parent,
      onComplete: function() {
        ready = true;
      }
    });

    $rootScope.$apply();

      expect( ready ).toBe( false );
<commit_msg>update(tests): dialog tests confirm arguments passed to onComplete.<commit_after>describe('$mdDialog', function() {
  
  beforeEach(TestUtil.mockRaf);
  beforeEach(module('material.components.dialog', 'ngAnimateMock'));

  beforeEach(inject(function spyOnMdEffects($mdEffects, $$q, $animate) {
    spyOn($mdEffects, 'popIn').andCallFake(function(element, parent, targetEvent) {
      parent.append(element);
      return $$q.when();
    });
    spyOn($animate, 'leave').andCallFake(function(element) {
      element.remove();
      return $$q.when();
    });

    spyOn($animate, 'enter').andCallFake(function(element, parent) {
      parent.append(element);
      return $$q.when();
    });
  }));

  it('should support onComplete callbacks within `show()`', inject(function($mdDialog, $rootScope, $timeout) {

    var template = '<md-dialog>Hello</md-dialog>';
    var parent = angular.element('<div>');
    var ready = false;

    $mdDialog.show({
      template: template,
      parent: parent,
      onComplete: function(scope, element, options) {
        expect( arguments.length ).toEqual( 3 );
        ready = true;
      }
    });

    $rootScope.$apply();

      expect( ready ).toBe( false );

{'fraction_non_alphanumeric': 0.1687116564417178, 'fraction_numerical': 0.00043821209465381246, 'mean_word_length': 3.547808764940239, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4875272', 'n_tokens_mistral': 699, 'n_tokens_neox': 682, 'n_words': 131}