Sha256: b95ffa389bd5c040f50fc5c9fa6b1b78ee5b52d68bfb85d5b5230bca1a988361

Contents?: true

Size: 1.21 KB

Versions: 62

Compression:

Stored size: 1.21 KB

Contents

(function () {
    'use strict';

    describe('WORKAREA.cloneableRows', function () {
        describe('init', function () {
            var triggerClone = function ($scope) {
                    $('tr:first [name]', $scope)
                        .first()
                        .trigger('input.cloneableRows');
                },

                $fixture;

            beforeEach(function () {
                var markup = 'cloneable_row.html';

                $fixture = $(fixture.load(markup, true));

                WORKAREA.cloneableRows.init($fixture);
            });

            it('clones its row on field input', function () {
                expect($('tr', $fixture).length).to.equal(1);
                expect($('label', $fixture).attr('for')).to.equal('foo');
                triggerClone($fixture);
                expect($('tr', $fixture).length).to.equal(2);
                expect($('tr:nth-child(2) label', $fixture).attr('for')).not.to.equal('foo');
            });

            it('clones itself only once', function () {
                triggerClone($fixture);
                triggerClone($fixture);

                expect($('tr', $fixture).length).to.equal(2);
            });
        });
    });
}());

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.5.26 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.4.45 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.5.25 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.5.23 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.4.44 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.5.22 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.4.43 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.5.21 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.4.42 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.5.20 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.4.41 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.5.19 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.4.40 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.5.18 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.4.39 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.5.17 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.4.38 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.5.16 test/javascripts/cloneable_rows_spec.js
workarea-admin-3.4.37 test/javascripts/cloneable_rows_spec.js