<commit_before>describe("WizardStep", function() {

    var step;

    beforeEach(function() {
        step = new WizardStep({url: '/foobar'});
    });

    it("should be initializable with url option", function() {
        expect(step.url).toEqual('/foobar');
    });

    it("should load the contents of given url via", function() {
        
        spyOn($, 'ajax').andCallFake(function (req) {
            var d = $.Deferred();
            d.resolve('<p>ffffuuuuuu</p>');
            return d.promise();
        });

        var asyncCallComplete = false;

        runs(function() {
            step.load().done(function() {
                asyncCallComplete = true;
            });
        });

        waitsFor(function() {
            return false !== asyncCallComplete;
        });

        return runs(function() {
            expect(step.content).toBe('<p>ffffuuuuuu</p>');
            expect($.ajax.mostRecentCall.args[0]["url"]).toEqual('/foobar');
        });

    });
});

describe("Wizard", function() {

    var wizard;

    beforeEach(function() {
        $('body').append('<div id="wizard"></div>');
        wizard = new Wizard('wizard');
    });

    it("should not have any steps by default", function() {
        expect(wizard.steps.length).toEqual(0);
    });

    it("should have default index of -1 before rendering", function() {
        expect(wizard.currentIndex).toEqual(-1);
    });

    it("should be able to add teps", function() {
        var step = new WizardStep({url: '/foobar'});
        wizard.addStep(step);
        expect(step.wizard).toEqual(wizard);
        expect(wizard.steps.length).toEqual(1);
        expect(step.id).toEqual(1);
        var step2 = new WizardStep({url: '/foobar2'});
        wizard.addStep(step2);
        expect(step2.id).toEqual(2);
        expect(wizard.steps.length).toEqual(2);
    });

    it("should render its basic skeleton template with first step", function() {        
        var step1 = new WizardStep({url: '/foobar'});
        wizard.addStep(step1);
        wizard.render();
        expect(wizard.currentStep).toEqual(step1);
    });
<commit_msg>Updating render spec<commit_after>describe("WizardStep", function() {

    var step;

    beforeEach(function() {
        step = new WizardStep({url: '/foobar'});
    });

    it("should be initializable with url option", function() {
        expect(step.url).toEqual('/foobar');
    });

    it("should load the contents of given url via", function() {
        
        spyOn($, 'ajax').andCallFake(function (req) {
            var d = $.Deferred();
            d.resolve('<p>ffffuuuuuu</p>');
            return d.promise();
        });

        var asyncCallComplete = false;

        runs(function() {
            step.load().done(function() {
                asyncCallComplete = true;
            });
        });

        waitsFor(function() {
            return false !== asyncCallComplete;
        });

        return runs(function() {
            expect(step.content).toBe('<p>ffffuuuuuu</p>');
            expect($.ajax.mostRecentCall.args[0]["url"]).toEqual('/foobar');
        });

    });
});

describe("Wizard", function() {

    var wizard;

    beforeEach(function() {
        $('body').append('<div id="wizard"></div>');
        wizard = new Wizard('wizard');
    });

    it("should not have any steps by default", function() {
        expect(wizard.steps.length).toEqual(0);
    });

    it("should have default index of -1 before rendering", function() {
        expect(wizard.currentIndex).toEqual(-1);
    });

    it("should be able to add teps", function() {
        var step = new WizardStep({url: '/foobar'});
        wizard.addStep(step);
        expect(step.wizard).toEqual(wizard);
        expect(wizard.steps.length).toEqual(1);
        expect(step.id).toEqual(1);
        var step2 = new WizardStep({url: '/foobar2'});
        wizard.addStep(step2);
        expect(step2.id).toEqual(2);
        expect(wizard.steps.length).toEqual(2);
    });

    it("should render its basic skeleton template with first step", function() {        
        var step1 = new WizardStep({url: '/foobar'});

        spyOn(step1, 'load').andCallFake(function (req) {
            var d = $.Deferred();
            d.resolve();
            return d.promise();
        });

        wizard.addStep(step1);
        wizard.render();
        expect(wizard.currentStep).toEqual(step1);
        expect(wizard.$content.find('div.wizard-step').length).toEqual(1);
        expect(step1.load).toHaveBeenCalled();
    });

{'fraction_non_alphanumeric': 0.16776750330250992, 'fraction_numerical': 0.00726552179656539, 'mean_word_length': 2.251968503937008, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '6678075', 'n_tokens_mistral': 1370, 'n_tokens_neox': 1330, 'n_words': 255}