Unverified Commit 6766695e authored by Jacob Kaufman's avatar Jacob Kaufman Committed by GitHub
Browse files

Merge pull request #102 from kaitlyndlee/testing

Fixed test failures and removed DrawControlTest
parents c448d0ea fec7055f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ import LayerCollection from "./LayerCollection";
import L from "leaflet";
import "leaflet-fullscreen";
import { MY_JSON_MAPS } from "./layers";
import "proj4leaflet";

/**
 * @class AstroMap

app/test/DrawControlTest.js

deleted100644 → 0
+0 −46
Original line number Diff line number Diff line
import { expect } from "chai";
import "jsdom-global/register";
import L from "leaflet";

import AstroDrawControl from "../src/js/AstroDrawControl";
import AstroMap from "../src/js/AstroMap";

describe("AstroDrawControl", function() {
  let testMap;
  let wktTextBox;
  let wktButton;
  let testControl;
  let drawnItems;

  beforeEach(function() {
    testMap = new AstroMap(document.createElement("div"), "Mars", {});
    wktTextBox = document.createElement("div");
    wktTextBox.id = "wktTextBox";
    document.body.appendChild(wktTextBox);

    wktButton = document.createElement("div");
    wktButton.id = "wktButton";
    document.body.appendChild(wktButton);

    drawnItems = new L.FeatureGroup();
    testMap.addLayer(drawnItems);

    testControl = new AstroDrawControl({
      edit: {
        featureGroup: drawnItems,
      },
    });
  });

  afterEach(function() {
    wktTextBox.remove();
    wktButton.remove();
    testControl.remove();
    testMap.remove();
  });

  it("should add the control to the map", function() {
    let returnMap = testMap.addControl(testControl);
    expect(returnMap).to.equal(testMap);
  });
});