Enable lib tests

This commit is contained in:
Tom MacWright
2016-09-05 10:22:45 -04:00
parent e659bd75e9
commit ed135ce9ef
43 changed files with 48 additions and 43 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { cmd } from '../ui/index';
export function Copy(context) {
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import { rebind } from '../util/rebind';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { chooseEdge, euclideanDistance } from '../geo/index';
import { Edit } from './edit';
import { Hover } from './hover';
+2 -2
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import { rebind } from '../util/rebind';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { Entity } from '../core/index';
/*
@@ -71,7 +71,7 @@ export function Hover() {
var down;
function mouseover() {
function mouseover(evt) {
if (down) return;
var target = d3.event.target;
enter(target ? target.__data__ : null);
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { ChangeTags, CopyEntities, Move as MoveAction} from '../actions/index';
import { Extent, pointInPolygon } from '../geo/index';
import { Move as MoveMode } from '../modes/index';
+1 -1
View File
@@ -2,7 +2,7 @@ import * as d3 from 'd3';
import _ from 'lodash';
import { rebind } from '../util/rebind';
import { functor } from '../util/index';
import { d3geoTile } from '../../js/lib/d3.geo.tile';
import { d3geoTile } from '../lib/d3.geo.tile';
import { Detect } from '../util/detect';
import { Entity } from './entity';
import { Extent } from '../geo/index';
+2
View File
@@ -8,6 +8,7 @@ import * as services from './services/index';
import * as svg from './svg/index';
import * as ui from './ui/index';
import * as util from './util/index';
import * as lib from './lib/index';
import * as validations from './validations/index';
// detect
@@ -50,6 +51,7 @@ export {
services,
svg,
util,
lib,
ui,
validations
};
+3
View File
@@ -0,0 +1,3 @@
export { d3combobox } from './d3.combobox';
export { d3geoTile } from './d3.geo.tile';
export { d3keybinding } from './d3.keybinding';
+1 -1
View File
@@ -1,5 +1,5 @@
import * as d3 from 'd3';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { Browse, Select } from './index';
import { Move as MoveAction, Noop } from '../actions/index';
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { Browse, Select } from './index';
import { Noop, RotateWay as RotateWayAction } from '../actions/index';
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import * as Operations from '../operations/index';
import { Breathe, Copy, Hover, Lasso, Paste, Select as SelectBehavior } from '../behavior/index';
+1 -1
View File
@@ -1,5 +1,5 @@
import * as d3 from 'd3';
import { d3geoTile } from '../../js/lib/d3.geo.tile';
import { d3geoTile } from '../lib/d3.geo.tile';
import { prefixCSSProperty, functor } from '../util/index';
export function TileLayer(context) {
+1 -1
View File
@@ -3,7 +3,7 @@ import * as d3 from 'd3';
import _ from 'lodash';
import rbush from 'rbush';
import { rebind } from '../util/rebind';
import { d3geoTile } from '../../js/lib/d3.geo.tile';
import { d3geoTile } from '../lib/d3.geo.tile';
import { Detect } from '../util/detect';
import { Extent } from '../geo/index';
import { Icon } from '../svg/index';
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { tooltip } from '../util/tooltip';
import { metersToOffset, offsetToMeters } from '../geo/index';
+1 -1
View File
@@ -1,7 +1,7 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { rebind } from '../util/rebind';
import { d3combobox } from '../../js/lib/d3.combobox.js';
import { d3combobox } from '../lib/d3.combobox.js';
import { t } from '../util/locale';
import { triggerEvent } from '../util/trigger_event';
import { tooltip } from '../util/tooltip';
+1 -1
View File
@@ -2,7 +2,7 @@ import * as d3 from 'd3';
import _ from 'lodash';
import { rebind } from '../../util/rebind';
import { getSetValue } from '../../util/get_set_value';
import { d3combobox } from '../../../js/lib/d3.combobox.js';
import { d3combobox } from '../../lib/d3.combobox.js';
export function access(field) {
var dispatch = d3.dispatch('change'),
+1 -1
View File
@@ -2,7 +2,7 @@ import * as d3 from 'd3';
import _ from 'lodash';
import { rebind } from '../../util/rebind';
import { getSetValue } from '../../util/get_set_value';
import { d3combobox } from '../../../js/lib/d3.combobox.js';
import { d3combobox } from '../../lib/d3.combobox.js';
import { Extent, chooseEdge, sphericalDistance } from '../../geo/index';
import { nominatim } from '../../services/index';
import { addressFormats } from '../../../data/index';
+1 -1
View File
@@ -3,7 +3,7 @@ import _ from 'lodash';
import { t } from '../../util/locale';
import { rebind } from '../../util/rebind';
import { getSetValue } from '../../util/get_set_value';
import { d3combobox } from '../../../js/lib/d3.combobox.js';
import { d3combobox } from '../../lib/d3.combobox.js';
import { nominatim } from '../../services/index';
export {
+1 -1
View File
@@ -1,7 +1,7 @@
import * as d3 from 'd3';
import { rebind } from '../../util/rebind';
import { getSetValue } from '../../util/get_set_value';
import { d3combobox } from '../../../js/lib/d3.combobox.js';
import { d3combobox } from '../../lib/d3.combobox.js';
export function cycleway(field) {
var dispatch = d3.dispatch('change'),
+1 -1
View File
@@ -1,7 +1,7 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { rebind } from '../../util/rebind';
import { d3combobox } from '../../../js/lib/d3.combobox.js';
import { d3combobox } from '../../lib/d3.combobox.js';
import { getSetValue } from '../../util/get_set_value';
import { t } from '../../util/locale';
import { tooltip } from '../../util/tooltip';
+1 -1
View File
@@ -2,7 +2,7 @@ import * as d3 from 'd3';
import _ from 'lodash';
import { rebind } from '../../util/rebind';
import { getSetValue } from '../../util/get_set_value';
import { d3combobox } from '../../../js/lib/d3.combobox.js';
import { d3combobox } from '../../lib/d3.combobox.js';
import { pointInPolygon } from '../../geo/index';
import { imperial as imperialData } from '../../../data/index';
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3combobox } from '../../../js/lib/d3.combobox.js';
import { d3combobox } from '../../lib/d3.combobox.js';
import { getSetValue } from '../../util/get_set_value';
import { rebind } from '../../util/rebind';
import { t } from '../../util/locale';
+1 -1
View File
@@ -1,5 +1,5 @@
import * as d3 from 'd3';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { cmd } from './cmd';
export function FullScreen(context) {
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import marked from 'marked';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { tooltip } from '../util/tooltip';
import { Icon } from '../svg/index';
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { Detect } from '../util/detect';
import { Extent } from '../geo/index';
+1 -1
View File
@@ -1,5 +1,5 @@
import * as d3 from 'd3';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { setDimensions } from '../util/dimensions';
import { tooltip } from '../util/tooltip';
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { tooltip } from '../util/tooltip';
import { Icon } from '../svg/index';
+1 -1
View File
@@ -1,5 +1,5 @@
import * as d3 from 'd3';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { Debug, Gpx } from '../svg/index';
import { RawMercator } from '../geo/index';
import { TileLayer } from '../renderer/index';
+1 -1
View File
@@ -1,5 +1,5 @@
import * as d3 from 'd3';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { Icon } from '../svg/index';
export function modal(selection, blocking) {
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { tooltip } from '../util/tooltip';
import { AddArea, AddLine, AddPoint, Browse } from '../modes/index';
import { Icon } from '../svg/index';
+1 -1
View File
@@ -2,7 +2,7 @@ import * as d3 from 'd3';
import _ from 'lodash';
import { rebind } from '../util/rebind';
import { getSetValue } from '../util/get_set_value';
import { d3combobox } from '../../js/lib/d3.combobox.js';
import { d3combobox } from '../lib/d3.combobox.js';
import { t } from '../util/locale';
import { Browse } from '../modes/index';
import { Disclosure } from './disclosure';
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import { rebind } from '../util/rebind';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { Browse } from '../modes/index';
import { ChangePreset } from '../actions/index';
+1 -1
View File
@@ -1,5 +1,5 @@
import * as d3 from 'd3';
import { d3combobox } from '../../js/lib/d3.combobox.js';
import { d3combobox } from '../lib/d3.combobox.js';
import { t } from '../util/locale';
import { Browse, Select } from '../modes/index';
import { ChangeMember, DeleteMember } from '../actions/index';
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3combobox } from '../../js/lib/d3.combobox.js';
import { d3combobox } from '../lib/d3.combobox.js';
import { t } from '../util/locale';
import { AddEntity, AddMember, ChangeMember, DeleteMember } from '../actions/index';
import { Entity, Relation } from '../core/index';
+1 -1
View File
@@ -1,7 +1,7 @@
import * as d3 from 'd3';
import { rebind } from '../util/rebind';
import { getSetValue } from '../util/get_set_value';
import { d3combobox } from '../../js/lib/d3.combobox.js';
import { d3combobox } from '../lib/d3.combobox.js';
import { t } from '../util/locale';
import { Disclosure } from './disclosure';
import { Icon } from '../svg/index';
+1 -1
View File
@@ -1,5 +1,5 @@
import * as d3 from 'd3';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { tooltip } from '../util/tooltip';
import { Save as SaveMode } from '../modes/index';
+1 -1
View File
@@ -1,5 +1,5 @@
import * as d3 from 'd3';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { tooltip } from '../util/tooltip';
import { Icon } from '../svg/index';
+1 -1
View File
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { tooltip } from '../util/tooltip';
import { Icon } from '../svg/index';
+2 -2
View File
@@ -63,8 +63,8 @@
<script src='spec/actions/unrestrict_turn.js'></script>
<script src='spec/behavior/hash.js'></script>
<script src='spec/behavior/hover.js'></script>
<script src='spec/behavior/select.js'></script>
<!-- <script src='spec/behavior/hover.js'></script> -->
<!-- <script src='spec/behavior/select.js'></script> -->
<script src='spec/behavior/lasso.js'></script>
<script src='spec/core/connection.js'></script>
+4 -4
View File
@@ -8,7 +8,7 @@ describe('d3.combobox', function() {
];
function simulateKeypress(key) {
var keyCode = d3.keybinding.keyCodes[key],
var keyCode = iD.lib.d3keybinding.keyCodes[key],
value = input.property('value'),
start = input.property('selectionStart'),
finis = input.property('selectionEnd');
@@ -61,7 +61,7 @@ describe('d3.combobox', function() {
body = d3.select('body');
content = body.append('div');
input = content.append('input');
combobox = d3.combobox();
combobox = iD.lib.d3combobox();
});
afterEach(function() {
@@ -85,8 +85,8 @@ describe('d3.combobox', function() {
input.property('value', 'b').call(combobox.data(data));
input.node().focus();
expect(body.selectAll('.combobox-option').size()).to.equal(2);
expect(body.selectAll('.combobox-option')[0][0].text).to.equal('bar');
expect(body.selectAll('.combobox-option')[0][1].text).to.equal('Baz');
expect(body.selectAll('.combobox-option').nodes()[0].text).to.equal('bar');
expect(body.selectAll('.combobox-option').nodes()[1].text).to.equal('Baz');
});
it('shows no menu on focus if it would contain only one item', function() {
+1 -1
View File
@@ -2,7 +2,7 @@ describe('d3.keybinding', function() {
var keybinding, spy, input;
beforeEach(function () {
keybinding = d3.keybinding('keybinding-test');
keybinding = iD.lib.d3keybinding('keybinding-test');
spy = sinon.spy();
input = d3.select('body')
.append('input');