<commit_before>sap.ui.define(
    [
        "openui5/googlemaps/Map",
        "openui5/googlemaps/MapsApi",
        "openui5/googlemaps/MapUtils",
        "openui5/googlemaps/MapTypeId",
        "openui5/googlemaps/Marker",
        "openui5/googlemaps/Polyline",
        "openui5/googlemaps/Polygon",
        "openui5/googlemaps/Directions",
        "openui5/googlemaps/MarkerCluster",
        "sap/ui/thirdparty/sinon",
        "sap/ui/thirdparty/sinon-qunit"
    ],
    function(Map, MapsApi, MapUtils, MapTypeId, Marker, Polyline, Polygon, Directions, MarkerCluster) {
        "use strict";

        sinon.config.useFakeTimers = false;

        var MAP_ID = 'MAP_TEST';
        var MAP_POSITION = {};
        MAP_POSITION.lat = parseFloat("-33.895");
        MAP_POSITION.lng = parseFloat("151.275");

        QUnit.module("Map - defaults test");


        QUnit.test("Object Creation and Destroy with Id", function(assert) {

            // Arrange    
            var sTestID = "MAP1";
            var oMap = new Map(sTestID, {
                lat: undefined,
                lng: undefined
            });

            assert.strictEqual(oMap.getId(), sTestID, "Map has ID: " + sTestID);
            oMap.placeAt("qunit-fixture");

            sap.ui.getCore().applyChanges();
            var oMap2 = sap.ui.getCore().byId(sTestID);

            // Act
            assert.ok(!!oMap2, "Object created and found byId");
            assert.ok(oMap2.$().size() > 0, "DOM has some content");
            assert.strictEqual(oMap.map, undefined, "no lat lng no map");


            // Assert
            // Destroy object
            oMap2.destroy();
            sap.ui.getCore().applyChanges();

            assert.ok(oMap2.$().size() === 0, "DOM content destroyed");

            // try to find destroyed object
            var oMap3 = sap.ui.getCore().byId(sTestID);
            assert.ok(!oMap3, "UI5 Object cannot be found");

            oMap.destroy();

        });

        QUnit.test("simulate latency on load", function(assert) {
            var oMap = new Map();
            var loadScriptsSpy = this.spy();
            this.stub(google.maps, "loaded", undefined);
            this.stub(jQuery.sap, "includeScript", loadScriptsSpy);

            // Act
            oMap.placeAt("qunit-fixture");
            sap.ui.getCore().applyChanges();

            //Assert
            assert.strictEqual(oMap.subscribed, true, "subscribed to GMAPS load");
            assert.strictEqual(loadScriptsSpy.callCount, 1, "include script called");
            oMap.destroy();
        });

        QUnit.module("Map Test Options");

        QUnit.test("Default config test", function(assert) {<commit_msg>[UPDATE] test commit message in sublime<commit_after>sap.ui.define(
    [
        "openui5/googlemaps/Map",
        "openui5/googlemaps/MapsApi",
        "openui5/googlemaps/MapUtils",
        "openui5/googlemaps/MapTypeId",
        "openui5/googlemaps/Marker",
        "openui5/googlemaps/Polyline",
        "openui5/googlemaps/Polygon",
        "openui5/googlemaps/Directions",
        "openui5/googlemaps/MarkerCluster",
        "sap/ui/thirdparty/sinon",
        "sap/ui/thirdparty/sinon-qunit"
    ],
    function(Map, MapsApi, MapUtils, MapTypeId, Marker, Polyline, Polygon, Directions, MarkerCluster) {
        "use strict";

        sinon.config.useFakeTimers = false;

        var MAP_ID = 'MAP_TEST';
        var MAP_POSITION = {};
        MAP_POSITION.lat = parseFloat("-33.895");
        MAP_POSITION.lng = parseFloat("151.275");

        QUnit.module("Map - defaults test");


        QUnit.test("Object Creation and Destroy with Id", function(assert) {

            // Arrange    
            var sTestID = "MAP1";
            var oMap = new Map(sTestID, {
                lat: undefined,
                lng: undefined
            });

            assert.strictEqual(oMap.getId(), sTestID, "Map has ID: " + sTestID);
            oMap.placeAt("qunit-fixture");

            sap.ui.getCore().applyChanges();
            var oMap2 = sap.ui.getCore().byId(sTestID);

            // Act
            assert.ok(!!oMap2, "Object created and found byId");
            assert.ok(oMap2.$().size() > 0, "DOM has some content");
            assert.strictEqual(oMap.map, undefined, "no lat lng no map");


            // Assert
            // Destroy object
            oMap2.destroy();
            sap.ui.getCore().applyChanges();

            assert.ok(oMap2.$().size() === 0, "DOM content destroyed");

            // try to find destroyed object
            var oMap3 = sap.ui.getCore().byId(sTestID);
            assert.ok(!oMap3, "UI5 Object cannot be found");

            oMap.destroy();

        });


        QUnit.test("simulate latency on load", function(assert) {
            var oMap = new Map();
            var loadScriptsSpy = this.spy();
            this.stub(google.maps, "loaded", undefined);
            this.stub(jQuery.sap, "includeScript", loadScriptsSpy);

            // Act
            oMap.placeAt("qunit-fixture");
            sap.ui.getCore().applyChanges();

            //Assert
            assert.strictEqual(oMap.subscribed, true, "subscribed to GMAPS load");
            assert.strictEqual(loadScriptsSpy.callCount, 1, "include script called");
            oMap.destroy();
        });

        QUnit.module("Map Test Options");

        QUnit.test("Default config test", function(assert) {
{'fraction_non_alphanumeric': 0.13461183846579383, 'fraction_numerical': 0.011801585838096994, 'mean_word_length': 1.917697686928456, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3769272', 'n_tokens_mistral': 1679, 'n_tokens_neox': 1619, 'n_words': 313}