@hackoregon/component-library
Version:
Official repo for Hack Oregon React component library
32 lines • 1.35 kB
JavaScript
import React from "react";
import { shallow } from "enzyme";
import BaseMap from "./BaseMap";
import ScatterPlotMap from "../ScatterPlotMap/ScatterPlotMap";
var MAPBOX_TOKEN = "pk.eyJ1IjoiaGFja29yZWdvbiIsImEiOiJjamk0MGZhc2cwNDl4M3FsdHAwaG54a3BnIn0.Fq1KA0IUwpeKQlFIoaEn_Q";
describe.skip("BaseMap", function () {
var defaultProps = {};
it("should render a MapGL component", function () {
var wrapper = shallow(React.createElement(BaseMap, defaultProps));
expect(wrapper.find(".MapGL")).to.have.length(1);
});
it("should include required prop mapboxApiAccessToken", function () {
var wrapper = shallow(React.createElement(BaseMap, defaultProps));
expect(wrapper.find(".MapGL").prop("mapboxApiAccessToken")).to.eql(MAPBOX_TOKEN);
});
it("should render child NavigationControl component", function () {
var wrapper = shallow(React.createElement(BaseMap, defaultProps));
expect(wrapper.find(".MapGL").children()).to.have.length(1);
});
it("should render child deck.gl layer component", function () {
var data = [{
geometry: {
type: "Point",
coordinates: [0, 0]
}
}];
var wrapper = shallow(React.createElement(BaseMap, defaultProps, React.createElement(ScatterPlotMap, {
data: data
})));
expect(wrapper.find(".MapGL").children()).to.have.length(2);
});
});