<commit_before>define(function(require, exports, module) {

// Imports

var _ = require('underscore');
var $ = require('jquery');
var rich = require('rich');
var Modifier = require('famous/core/Modifier');
var Rectangle = require('app/shared/models/rectangle').Rectangle;
var RectangleView = require('app/shared/views/rectangle-view').RectangleView;
var render = require('tests/utils/time').render;
var colors = require('tests/utils/colors').blue;



describe('Auto Layout:', function() {
    var region;
    var $el;

    beforeEach(function() {
        loadFixtures('famous.html');

        region = new rich.Region({
            el: '#famous-context'
        });

        $el = region.el;
        expect($el.length).toBe(1);
    });

    afterEach(function() {
        region = null;
    });


    xit('initializes autolayout', function(){
        var model = new Rectangle();
        var view = new RectangleView({model: model});
        region.show(view);
        expect(view._autolayout).not.toBe(undefined);
    });

    xit('sets explicit size on subview', function(done){
        var model = new Rectangle();

        var view = new RectangleView({
            model: model,
            // constraints: [
            //     {
            //         item: 'navigation',
            //         attribute: 'width',
            //         relatedBy: '==', // '=|>=|<='
            //         toItem: 'superview', //'null is superview'
            //         toAttribute: 'width',
            //         multiplier: 0.5,
            //         constant: 0
            //     }
            // ]
        });
        view.navigation = new RectangleView({
            model:model,
            size: [100, 200]
        });
        view.addSubview(view.navigation);
        region.show(view);

        render().then(function(){
            expect(view.navigation.getSize()).toEqual([100, 200]);
            done();
        });
    });

    xit('inherits size', function(done){
        var model = new Rectangle();

        var view = new RectangleView({
            model: model,
        });
        view.navigation = new rich.View({});
        view.addSubview(view.navigation);
        region.show(view);

        render().then(function(){
            expect(view.navigation.getSize()).toEqual([1000, 800]);
            done();
        });
    });

    xit('ignores constraints over explicit size', function(done){
        var model = new Rectangle();

        var view = new RectangleView({
            model: model,
            constraints: [
                {
                    item: 'navigation',
                    attribute: 'width',
                    relatedBy: '==', // '=|>=|<='
                    toItem: 'superview', //'null is superview'
                    toAttribute: 'width',
                    multiplier: 0.5,
                    constant: 0
                }
            ]
        });
        view.navigation = new RectangleView({
            model:model,
            size: [100, 200]
        });
        view.addSubview(view.navigation);
        region.show(view);

        render().then(function(){
            expect(view.navigation.getSize()).toEqual([100, 200]);
            done();
        });
    });

    it('ignores constraints over explicit size', function(done){
        var model = new Rectangle();

        var view = new RectangleView({
            model: model,
            constraints: [
                {
                    item: 'navigation',
                    attribute: 'width',
                    relatedBy: '==', // '=|>=|<='
                    toItem: 'superview', //'null is superview'
                    toAttribute: 'width',
                    multiplier: 0.5,
                    constant: 0
                }
            ]
        });
        view.navigation = new RectangleView({
            model:model,
        });
        view.name = 'rectangle'
        view.navigation.name = 'navigation'
        view.addSubview(view.navigation);
        region.show(view);

        render().then(function(){
            console.log(view.navigation.getSize())
            // expect(view.navigation.getSize()).toEqual([500, 800]);
            done();
        });
    });


}); // eof describe
}); // eof define
<commit_msg>renamed test<commit_after>define(function(require, exports, module) {

// Imports

var _ = require('underscore');
var $ = require('jquery');
var rich = require('rich');
var Modifier = require('famous/core/Modifier');
var Rectangle = require('app/shared/models/rectangle').Rectangle;
var RectangleView = require('app/shared/views/rectangle-view').RectangleView;
var render = require('tests/utils/time').render;
var colors = require('tests/utils/colors').blue;



describe('Auto Layout:', function() {
    var region;
    var $el;

    beforeEach(function() {
        loadFixtures('famous.html');

        region = new rich.Region({
            el: '#famous-context'
        });

        $el = region.el;
        expect($el.length).toBe(1);
    });

    afterEach(function() {
        region = null;
    });


    xit('initializes autolayout', function(){
        var model = new Rectangle();
        var view = new RectangleView({model: model});
        region.show(view);
        expect(view._autolayout).not.toBe(undefined);
    });

    xit('sets explicit size on subview', function(done){
        var model = new Rectangle();

        var view = new RectangleView({
            model: model,
            // constraints: [
            //     {
            //         item: 'navigation',
            //         attribute: 'width',
            //         relatedBy: '==', // '=|>=|<='
            //         toItem: 'superview', //'null is superview'
            //         toAttribute: 'width',
            //         multiplier: 0.5,
            //         constant: 0
            //     }
            // ]
        });
        view.navigation = new RectangleView({
            model:model,
            size: [100, 200]
        });
        view.addSubview(view.navigation);
        region.show(view);

        render().then(function(){
            expect(view.navigation.getSize()).toEqual([100, 200]);
            done();
        });
    });

    xit('inherits size', function(done){
        var model = new Rectangle();

        var view = new RectangleView({
            model: model,
        });
        view.navigation = new rich.View({});
        view.addSubview(view.navigation);
        region.show(view);

        render().then(function(){
            expect(view.navigation.getSize()).toEqual([1000, 800]);
            done();
        });
    });

    xit('ignores constraints over explicit size', function(done){
        var model = new Rectangle();

        var view = new RectangleView({
            model: model,
            constraints: [
                {
                    item: 'navigation',
                    attribute: 'width',
                    relatedBy: '==', // '=|>=|<='
                    toItem: 'superview', //'null is superview'
                    toAttribute: 'width',
                    multiplier: 0.5,
                    constant: 0
                }
            ]
        });
        view.navigation = new RectangleView({
            model:model,
            size: [100, 200]
        });
        view.addSubview(view.navigation);
        region.show(view);

        render().then(function(){
            expect(view.navigation.getSize()).toEqual([100, 200]);
            done();
        });
    });

    it('uses constraints', function(done){
        var model = new Rectangle();

        var view = new RectangleView({
            model: model,
            constraints: [
                {
                    item: 'navigation',
                    attribute: 'width',
                    relatedBy: '==', // '=|>=|<='
                    toItem: 'superview', //'null is superview'
                    toAttribute: 'width',
                    multiplier: 0.5,
                    constant: 0
                }
            ]
        });
        view.navigation = new RectangleView({
            model:model,
        });
        view.name = 'rectangle'
        view.navigation.name = 'navigation'
        view.addSubview(view.navigation);
        region.show(view);

        render().then(function(){
            console.log(view.navigation.getSize())
            // expect(view.navigation.getSize()).toEqual([500, 800]);
            done();
        });
    });


}); // eof describe
}); // eof define

{'fraction_non_alphanumeric': 0.1469656062918183, 'fraction_numerical': 0.011034158938842588, 'mean_word_length': 1.4948755490483163, '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': '7124311', 'n_tokens_mistral': 2351, 'n_tokens_neox': 2200, 'n_words': 450}