<commit_before>describe("core-init", function() {
    var mapal;

    requireDependencies(["core/init"], function(cls) {
        mapal = cls;
    });

    // Reset the lab before each test
    beforeEach(function() {
        $("#lab *").remove();
    });

    describe("_convertToIframes", function() {
        it("Keep non-html objects", function() {
            var $lab = $("#lab");
            $lab.append('<object type="text/plain">Plain content</object>');
            mapal._convertToIframes($lab);
            expect($lab.find("object").length).toBe(1);
        });

        it("Transform text/html objects", function() {
            var $lab = $("#lab");
            $lab.append('<object type="text/html" data="about.html">Plain content</object>');
            mapal._convertToIframes($lab);
            expect($lab.find("object").length).toBe(0);
            var $iframe = $lab.find("iframe");
            expect($iframe.length).toBe(1);
            expect($iframe[0].src).toMatch(/about.html$/);
        });
    });

    describe("transformContent", function() {
        it("Convert legend to p.legend", function() {
            var $lab = $("#lab");
            $lab.append("<fieldset><legend>Fieldset title</legend></fieldset>");
            mapal.transformContent($lab[0]);
            expect($lab.html()).toBe('<fieldset><p class="legend">Fieldset title</p></fieldset>');
        });

        it("Keep text/html objects on non-IE", function() {
            var $lab = $("#lab"),
                old_msie = $.browser.msie;
            spyOn(mapal, "_convertToIframes");<commit_msg>Do not load missing file in iframe test<commit_after>describe("core-init", function() {
    var mapal;

    requireDependencies(["core/init"], function(cls) {
        mapal = cls;
    });

    // Reset the lab before each test
    beforeEach(function() {
        $("#lab *").remove();
    });

    describe("_convertToIframes", function() {
        it("Keep non-html objects", function() {
            var $lab = $("#lab");
            $lab.append('<object type="text/plain">Plain content</object>');
            mapal._convertToIframes($lab);
            expect($lab.find("object").length).toBe(1);
        });

        it("Transform text/html objects", function() {
            var $lab = $("#lab");
            $lab.append('<object type="text/html" data="about:blank">Plain content</object>');
            mapal._convertToIframes($lab);
            expect($lab.find("object").length).toBe(0);
            var $iframe = $lab.find("iframe");
            expect($iframe.length).toBe(1);
            expect($iframe[0].src).toBe("about:blank");
        });
    });

    describe("transformContent", function() {
        it("Convert legend to p.legend", function() {
            var $lab = $("#lab");
            $lab.append("<fieldset><legend>Fieldset title</legend></fieldset>");
            mapal.transformContent($lab[0]);
            expect($lab.html()).toBe('<fieldset><p class="legend">Fieldset title</p></fieldset>');
        });

        it("Keep text/html objects on non-IE", function() {
            var $lab = $("#lab"),
                old_msie = $.browser.msie;
            spyOn(mapal, "_convertToIframes");
{'fraction_non_alphanumeric': 0.1894835096453018, 'fraction_numerical': 0.0031113876789047915, 'mean_word_length': 2.355949895615866, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '3773381', 'n_tokens_mistral': 923, 'n_tokens_neox': 892, 'n_words': 162}