Include html character code in text style test

This commit is contained in:
mike-000
2020-01-19 11:42:59 +00:00
committed by GitHub
parent 23858dc09d
commit bf23dca068
+3 -3
View File
@@ -2238,7 +2238,7 @@ describe('ol.format.KML', function() {
expect(style.getZIndex()).to.be(undefined); expect(style.getZIndex()).to.be(undefined);
}); });
it('can create text style for named point placemarks', function() { it('can create text style for named point placemarks (including html character codes)', function() {
const text = const text =
'<kml xmlns="http://www.opengis.net/kml/2.2"' + '<kml xmlns="http://www.opengis.net/kml/2.2"' +
' xmlns:gx="http://www.google.com/kml/ext/2.2"' + ' xmlns:gx="http://www.google.com/kml/ext/2.2"' +
@@ -2266,7 +2266,7 @@ describe('ol.format.KML', function() {
' </Pair>' + ' </Pair>' +
' </StyleMap>' + ' </StyleMap>' +
' <Placemark>' + ' <Placemark>' +
' <name>Test</name>' + ' <name>Joe&apos;s Test</name>' +
' <styleUrl>#msn_ylw-pushpin0</styleUrl>' + ' <styleUrl>#msn_ylw-pushpin0</styleUrl>' +
' <Point>' + ' <Point>' +
' <coordinates>1,2</coordinates>' + ' <coordinates>1,2</coordinates>' +
@@ -2281,7 +2281,7 @@ describe('ol.format.KML', function() {
expect(styleFunction).not.to.be(undefined); expect(styleFunction).not.to.be(undefined);
const style = styleFunction(f, 0); const style = styleFunction(f, 0);
expect(style).to.be.an(Style); expect(style).to.be.an(Style);
expect(style.getText().getText()).to.eql(f.getProperties()['name']); expect(style.getText().getText()).to.eql('Joe's Test');
}); });
it('can write an feature\'s icon style', function() { it('can write an feature\'s icon style', function() {