Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin committed Jun 28, 2024
1 parent 5bf7019 commit f58a575
Show file tree
Hide file tree
Showing 4 changed files with 487 additions and 105 deletions.
90 changes: 0 additions & 90 deletions debug/app.js

This file was deleted.

12 changes: 0 additions & 12 deletions debug/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,6 @@

mapboxgl.accessToken = getAccessToken();

const StaticMode = {};

StaticMode.onSetup = function () {
this.setActionableState(); // default actionable state is false for all actions
return {};
};

StaticMode.toDisplayFeatures = function (state, geojson, display) {
display(geojson);
};

const map = new mapboxgl.Map({
container: 'map',
zoom: 1,
Expand All @@ -90,7 +79,6 @@
map.addControl(new mapboxgl.NavigationControl(), 'top-left');

const modes = MapboxDraw.modes;
modes.static = StaticMode;
const Draw = window.Draw = new MapboxDraw({ modes });
let drawIsActive = true;
map.addControl(Draw, 'bottom-right');
Expand Down
3 changes: 1 addition & 2 deletions test/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,7 @@ test('Draw.modes', () => {
assert.equal(Draw.modes.DRAW_POINT, Constants.modes.DRAW_POINT, 'draw_point');
assert.equal(Draw.modes.DRAW_LINE_STRING, Constants.modes.DRAW_LINE_STRING, 'draw_line_string');
assert.equal(Draw.modes.DRAW_POLYGON, Constants.modes.DRAW_POLYGON, 'draw_polygon');
assert.equal(Draw.modes.STATIC, Constants.modes.STATIC, 'static');
assert.equal(getPublicMemberKeys(Draw.modes).length, 6, 'no unexpected modes');
assert.equal(getPublicMemberKeys(Draw.modes).length, 5, 'no unexpected modes');
});

test('Draw.combineFeatures -- polygon + polygon = multiploygon', () => {
Expand Down
Loading

0 comments on commit f58a575

Please sign in to comment.