-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow suffixes to be added to gazetteer field names (#675)
* Allow suffixes to be added to field names * Set correct scope
- Loading branch information
1 parent
5ef40f3
commit f42b509
Showing
2 changed files
with
67 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,54 @@ | ||
describe('CpsiMapview.view.combo.Gazetteer', function() { | ||
describe('Basics', function() { | ||
it('is defined', function() { | ||
describe('CpsiMapview.view.combo.Gazetteer', function () { | ||
|
||
Ext.define('TestGazetteerModel', { | ||
extend: 'Ext.data.Model', | ||
|
||
fields: [ | ||
{ name: 'minX3857', type: 'float' }, | ||
{ name: 'minY3857', type: 'float' }, | ||
{ name: 'maxX3857', type: 'float' }, | ||
{ name: 'maxY3857', type: 'float' } | ||
], | ||
|
||
// Other configurations for your model can go here | ||
}); | ||
|
||
describe('Basics', function () { | ||
it('is defined', function () { | ||
expect(CpsiMapview.view.combo.Gazetteer).not.to.be(undefined); | ||
}); | ||
|
||
it('can be instantiated', function() { | ||
it('can be instantiated', function () { | ||
var inst = Ext.create('CpsiMapview.view.combo.Gazetteer', {}); | ||
expect(inst).to.be.a(CpsiMapview.view.combo.Gazetteer); | ||
}); | ||
|
||
it('can get an extent record', function () { | ||
var inst = Ext.create('CpsiMapview.view.combo.Gazetteer', {}); | ||
|
||
var rec = Ext.create('TestGazetteerModel', { | ||
minX3857: 0, | ||
minY3857: 0, | ||
maxX3857: 100, | ||
maxY3857: 100, | ||
}); | ||
|
||
var extent = inst.convertToExtent(null, rec); | ||
expect(extent.toString()).to.equal([0, 0, 100, 100].toString()); | ||
}); | ||
|
||
it('can get an extent record with alternate field names', function () { | ||
var inst = Ext.create('CpsiMapview.view.combo.Gazetteer', { fieldNameSuffix: '2157' }); | ||
|
||
var rec = Ext.create('TestGazetteerModel', { | ||
minX2157: 0, | ||
minY2157: 0, | ||
maxX2157: 100, | ||
maxY2157: 100, | ||
}); | ||
|
||
var extent = inst.convertToExtent(null, rec); | ||
expect(extent.toString()).to.equal([0, 0, 100, 100].toString()); | ||
}); | ||
}); | ||
}); |