mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-03 13:38:04 +02:00
Merge branch 'master' into validation
This commit is contained in:
@@ -16,11 +16,13 @@ describe('iD.rendererBackgroundSource', function() {
|
||||
var source = iD.rendererBackgroundSource({
|
||||
type: 'wms',
|
||||
projection: 'EPSG:3857',
|
||||
template: 'SRS={proj}&FORMAT=image/jpeg&WIDTH={width}&HEIGHT={height}&BBOX={bbox}'
|
||||
template: 'SRS={proj}&imageSR={wkid}&bboxSR={wkid}&FORMAT=image/jpeg&WIDTH={width}&HEIGHT={height}&BBOX={bbox}'
|
||||
});
|
||||
|
||||
var result = iD.utilStringQs(source.url([0,1,2]));
|
||||
expect(result.SRS).to.equal('EPSG:3857');
|
||||
expect(result.imageSR).to.equal('3857');
|
||||
expect(result.bboxSR).to.equal('3857');
|
||||
expect(result.FORMAT).to.equal('image/jpeg');
|
||||
expect(result.WIDTH).to.equal('256');
|
||||
expect(result.HEIGHT).to.equal('256');
|
||||
|
||||
@@ -246,7 +246,15 @@ describe('iD.serviceOsmWikibase', function () {
|
||||
type: 'statement',
|
||||
rank: 'normal'
|
||||
}
|
||||
]
|
||||
],
|
||||
P31: [
|
||||
{mainsnak: {datavalue: {value: {text: 'Cs:Key:bridge:movable', language: 'cs'}}}},
|
||||
{mainsnak: {datavalue: {value: {text: 'DE:Key:bridge:movable', language: 'de'}}}},
|
||||
{mainsnak: {datavalue: {value: {text: 'FR:Key:bridge:movable', language: 'fr'}}}},
|
||||
{mainsnak: {datavalue: {value: {text: 'JA:Key:bridge:movable', language: 'ja'}}}},
|
||||
{mainsnak: {datavalue: {value: {text: 'Pl:Key:bridge:movable', language: 'pl'}}}},
|
||||
{mainsnak: {datavalue: {value: {text: 'Key:bridge:movable', language: 'en'}}}},
|
||||
],
|
||||
},
|
||||
sitelinks: {
|
||||
wiki: {
|
||||
@@ -319,4 +327,15 @@ describe('iD.serviceOsmWikibase', function () {
|
||||
expect(wikibase.claimToValue(keyData(), 'P6', 'de')).to.eql('Q14');
|
||||
});
|
||||
|
||||
it('gets monolingual value from entity as an object', function () {
|
||||
expect(wikibase.monolingualClaimToValueObj(tagData(), 'P31')).to.eql({
|
||||
cs: 'Cs:Key:bridge:movable',
|
||||
de: 'DE:Key:bridge:movable',
|
||||
fr: 'FR:Key:bridge:movable',
|
||||
ja: 'JA:Key:bridge:movable',
|
||||
pl: 'Pl:Key:bridge:movable',
|
||||
en: 'Key:bridge:movable',
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
+11
-15
@@ -18,7 +18,7 @@ describe('uiCombobox', function() {
|
||||
iD.d3.customEvent(happen.makeEvent({
|
||||
type: 'keydown',
|
||||
keyCode: keyCode
|
||||
}), input.on('keydown.typeahead'));
|
||||
}), input.on('keydown.combobox'));
|
||||
|
||||
switch (key) {
|
||||
case '⇥':
|
||||
@@ -80,7 +80,7 @@ describe('uiCombobox', function() {
|
||||
|
||||
function focusTypeahead(input) {
|
||||
input.node().focus();
|
||||
d3.customEvent(happen.makeEvent('focus'), input.on('focus.typeahead'));
|
||||
d3.customEvent(happen.makeEvent('focus'), input.on('focus.combobox'));
|
||||
}
|
||||
|
||||
it('adds the combobox-input class', function() {
|
||||
@@ -90,7 +90,8 @@ describe('uiCombobox', function() {
|
||||
|
||||
it('adds combobox under container', function() {
|
||||
input.call(combobox.data(data));
|
||||
body.selectAll('.combobox-input').dispatch('mousedown');
|
||||
focusTypeahead(input);
|
||||
simulateKeypress('↓');
|
||||
expect(d3.select('.id-container > div.combobox').nodes().length).to.equal(1);
|
||||
});
|
||||
|
||||
@@ -106,17 +107,12 @@ describe('uiCombobox', function() {
|
||||
|
||||
it('shows all entries when clicking on the caret', function() {
|
||||
input.property('value', 'foobar').call(combobox.data(data));
|
||||
body.selectAll('.combobox-input').dispatch('mousedown');
|
||||
focusTypeahead(input);
|
||||
simulateKeypress('↓');
|
||||
expect(body.selectAll('.combobox-option').size()).to.equal(5);
|
||||
expect(body.selectAll('.combobox-option').text()).to.equal('foobar');
|
||||
});
|
||||
|
||||
it('is initially shown with no selection', function() {
|
||||
input.call(combobox.data(data));
|
||||
body.selectAll('.combobox-input').dispatch('mousedown');
|
||||
expect(body.selectAll('.combobox-option.selected').size()).to.equal(0);
|
||||
});
|
||||
|
||||
it('selects the first option that matches the input', function() {
|
||||
input.call(combobox.data(data));
|
||||
focusTypeahead(input);
|
||||
@@ -261,15 +257,15 @@ describe('uiCombobox', function() {
|
||||
simulateKeypress('↩');
|
||||
});
|
||||
|
||||
it('emits cancel event with selected datum on ⎋', function(done) {
|
||||
combobox.on('cancel', function(d) {
|
||||
expect(d).to.eql({title: 'bar', value: 'bar'});
|
||||
done();
|
||||
});
|
||||
it('emits cancel event on ⎋', function() {
|
||||
var spy = sinon.spy();
|
||||
combobox.on('cancel', spy);
|
||||
|
||||
input.call(combobox.data(data));
|
||||
focusTypeahead(input);
|
||||
simulateKeypress('b');
|
||||
simulateKeypress('⎋');
|
||||
expect(spy).to.have.been.calledOnce;
|
||||
});
|
||||
|
||||
it('hides on ↩', function() {
|
||||
|
||||
Reference in New Issue
Block a user