<commit_before>YUI.add('module-tests', function(Y) {

    var suite = new Y.Test.Suite('aui-form-builder');

    var diagramBuilder = new Y.DiagramBuilder({
        availableFields: [],
        boundingBox: '#diagramBuilder',
        fields: [
            {
                name: 'Start0',
                type: 'start',
                xy: [10, 10]
            },
            {
                name: 'EndNode0',
                type: 'end',
                xy: [600, 250]
            }
        ]
    }).render();

    diagramBuilder.connectAll([
        {
            connector: { name: 'Link0' },
            source: 'Start0',
            target: 'EndNode0'
        }
    ]);

    suite.add(new Y.Test.Case({
        name: 'DiagramBuilder',
        'test connectors offset after introducing changes on the page': function() {
        	var fields = diagramBuilder.get('fields'),
        		startNode = fields.item(0),
        		transition = startNode.get('transitions').values()[0],
        		connector = startNode.getConnector(transition);

        	var startP1 = connector.get('p1'),
        		startP2 = connector.get('p2');

        	var largeContent = Y.Node.create('<div style="height: 200px; width: 100px; border: 1px solid">Large Content</div>');

        	largeContent.prependTo(document.body);

        	diagramBuilder.syncUI();

        	var endP1 = connector.get('p1'),
        		endP2 = connector.get('p2');

            Y.Assert.areNotEqual(startP1, endP1);
            Y.Assert.areNotEqual(startP2, endP2);

            largeContent.remove();
        }
    }));

    Y.Test.Runner.add(suite);

}, '', {
    requires: ['test', 'aui-diagram-builder']
});<commit_msg>AUI-972 Source formatting<commit_after>YUI.add('module-tests', function(Y) {

    var suite = new Y.Test.Suite('aui-form-builder');

    var diagramBuilder = new Y.DiagramBuilder({
        availableFields: [],
        boundingBox: '#diagramBuilder',
        fields: [
            {
                name: 'Start0',
                type: 'start',
                xy: [10, 10]
            },
            {
                name: 'EndNode0',
                type: 'end',
                xy: [600, 250]
            }
        ]
    }).render();

    diagramBuilder.connectAll([
        {
            connector: {
                name: 'Link0'
            },
            source: 'Start0',
            target: 'EndNode0'
        }
    ]);

    suite.add(new Y.Test.Case({
        name: 'DiagramBuilder',
        'test connectors offset after introducing changes on the page': function() {
            var fields = diagramBuilder.get('fields'),
                startNode = fields.item(0),
                transition = startNode.get('transitions').values()[0],
                connector = startNode.getConnector(transition);

            var startP1 = connector.get('p1'),
                startP2 = connector.get('p2');

            var largeContent = Y.Node.create(
                '<div style="height: 200px; width: 100px; border: 1px solid">Large Content</div>');

            largeContent.prependTo(document.body);

            diagramBuilder.syncUI();

            var endP1 = connector.get('p1'),
                endP2 = connector.get('p2');

            Y.Assert.areNotEqual(startP1, endP1);
            Y.Assert.areNotEqual(startP2, endP2);

            largeContent.remove();
        }
    }));

    Y.Test.Runner.add(suite);

}, '', {
    requires: ['test', 'aui-diagram-builder']
});
{'fraction_non_alphanumeric': 0.14128864490031784, 'fraction_numerical': 0.02167003756139844, 'mean_word_length': 1.669236700077101, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4661270', 'n_tokens_mistral': 1075, 'n_tokens_neox': 990, 'n_words': 187}