<commit_before>'use strict';

var assert = chai.assert;
var dir    = require('../index.js');
var page   = require('page');

/*******************************
 *  Basic Object Construction  *
 *******************************/

describe('Directives', function() {

    describe('load()', function() {
        var div = document.createElement('div');
        var div2 = document.createElement('div');

        div2.innerHTML = 'test';

        it('should load an element in to a parent element when a page has triggered', function() {
            page('/', dir.load(div, div2), function() {
                assert.equal(div.children[0].innerHTML, 'test');
            });
            page('/');
        });
    });

    describe('clear()', function() {
        var div = document.createElement('div');
        var div2 = document.createElement('div');

        div.appendChild(div2);

        it('should clear all child elements from the parent element', function() {
            page('/', dir.clear(div), function() {
                assert.equal(div.children.length, 0);
            });
            page('/');
        });
    });

    describe('fade()', function() {
        var div = document.createElement('div');

        div.innerHTML = 'test';

        it('should transition opacity of element to .5 in 500ms', function() {
            page('/', dir.fade(div,[0,.5], 500), function() {
                assert.equal(div.style.opacity, .5);
            });
            page('/');
        });
    });<commit_msg>Testing fade directive<commit_after>'use strict';

var assert = chai.assert;
var dir    = require('../index.js');
var page   = require('page');

page.base('/test');

/*******************************
 *  Basic Object Construction  *
 *******************************/

describe('Directives', function() {

    describe('load()', function() {
        var div = document.createElement('div');
        var div2 = document.createElement('div');

        div2.innerHTML = 'test';

        it('should load an element in to a parent element when a page has triggered', function() {
            page('/load', dir.load(div, div2), function() {
                assert.equal(div.children[0].innerHTML, 'test');
            });
            page('/load');
        });
    });

    describe('clear()', function() {
        var div = document.createElement('div');
        var div2 = document.createElement('div');

        div.appendChild(div2);

        it('should clear all child elements from the parent element', function() {
            page('/clear', dir.clear(div), function() {
                assert.equal(div.children.length, 0);
            });
            page('/clear');
        });
    });

    describe('fade()', function() {
        var div = document.createElement('div');

        it('should transition opacity of element to .5 in 500ms', function(ok) {
            page('/fade', dir.fade(div,[0,0.5], 500));
            page('/fade');

            setTimeout(function() {
                assert.equal(div.style.opacity, 0.5);
                ok();
            }, 600);
        });
    });
{'fraction_non_alphanumeric': 0.20238478891395423, 'fraction_numerical': 0.012568482114083145, 'mean_word_length': 2.164118246687054, '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': '5164203', 'n_tokens_mistral': 843, 'n_tokens_neox': 789, 'n_words': 197}