<commit_before>describe("go.components.plumbing (connections)", function() {
  var stateMachine = go.components.stateMachine;
      plumbing = go.components.plumbing;

  var testHelpers = plumbing.testHelpers,
      setUp = testHelpers.setUp,
      newSimpleDiagram = testHelpers.newSimpleDiagram,
      newComplexDiagram = testHelpers.newComplexDiagram,
      tearDown = testHelpers.tearDown;

  beforeEach(function() {
    setUp();
  });

  afterEach(function() {
    tearDown();
  });

  describe(".ConnectionView", function() {
    var ConnectionModel = stateMachine.ConnectionModel,
        ConnectionView = plumbing.ConnectionView;

    var diagram,
        x1,
        y1,
        x3_y2;

    beforeEach(function() {
      diagram = new newSimpleDiagram();
      x1 = diagram.endpoints.get('x1');
      y1 = diagram.endpoints.get('y1');
      x3_y2 = diagram.connections.get('x3-y2');
      diagram.render();
    });

    describe(".destroy", function() {
      it("should remove the actual jsPlumb connection", function(done) {
        var plumbConnection = x3_y2.plumbConnection;

        assert(plumbConnection);

        jsPlumb.bind('connectionDetached', function(e) {
          assert.equal(plumbConnection, e.connection);
          assert.isNull(x3_y2.plumbConnection);
          done();
        });

        x3_y2.destroy();
      });
    });

    describe(".render", function() {
      var connection;

      beforeEach(function(done) {
        diagram.connections.on('add', function(id, addedConnection) {
          connection = addedConnection;
          done();
        });

        diagram.connections.add('connections', {
          model: {
            source: {uuid: 'x1'},
            target: {uuid: 'y1'}
          }
        }, {render: false});
      });

      it("should create the actual jsPlumb connection", function(done) {
        jsPlumb.bind('connection', function(e) {
          assert(connection.source.$el.is(e.source));
          assert(connection.target.$el.is(e.target));
          done();
        });

        connection.render();
      });
    });
  });
<commit_msg>Removed unnecessary event callback from ConnectionView test beforeEach()<commit_after>describe("go.components.plumbing (connections)", function() {
  var stateMachine = go.components.stateMachine;
      plumbing = go.components.plumbing;

  var testHelpers = plumbing.testHelpers,
      setUp = testHelpers.setUp,
      newSimpleDiagram = testHelpers.newSimpleDiagram,
      newComplexDiagram = testHelpers.newComplexDiagram,
      tearDown = testHelpers.tearDown;

  beforeEach(function() {
    setUp();
  });

  afterEach(function() {
    tearDown();
  });

  describe(".ConnectionView", function() {
    var ConnectionModel = stateMachine.ConnectionModel,
        ConnectionView = plumbing.ConnectionView;

    var diagram,
        x1,
        y1,
        x3_y2;

    beforeEach(function() {
      diagram = new newSimpleDiagram();
      x1 = diagram.endpoints.get('x1');
      y1 = diagram.endpoints.get('y1');
      x3_y2 = diagram.connections.get('x3-y2');
      diagram.render();
    });

    describe(".destroy", function() {
      it("should remove the actual jsPlumb connection", function(done) {
        var plumbConnection = x3_y2.plumbConnection;

        assert(plumbConnection);

        jsPlumb.bind('connectionDetached', function(e) {
          assert.equal(plumbConnection, e.connection);
          assert.isNull(x3_y2.plumbConnection);
          done();
        });

        x3_y2.destroy();
      });
    });

    describe(".render", function() {
      var connection;

      beforeEach(function() {
        connection = diagram.connections.add('connections', {
          model: {
            source: {uuid: 'x1'},
            target: {uuid: 'y1'}
          }
        }, {render: false});
      });

      it("should create the actual jsPlumb connection", function(done) {
        jsPlumb.bind('connection', function(e) {
          assert(connection.source.$el.is(e.source));
          assert(connection.target.$el.is(e.target));
          done();
        });

        connection.render();
      });
    });
  });

{'fraction_non_alphanumeric': 0.13595749818884328, 'fraction_numerical': 0.009659502535619416, 'mean_word_length': 2.480672268907563, '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': '6541774', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1189, 'n_words': 202}