mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
All iD sprite graphics are now prefixed with `iD-` Also includes support for sending the preset logos to taginfo
20 lines
726 B
JavaScript
20 lines
726 B
JavaScript
describe('iD.svgIcon', function () {
|
|
var selection;
|
|
|
|
beforeEach(function () {
|
|
selection = d3.select(document.createElement('div'));
|
|
});
|
|
|
|
it('creates a generic SVG icon', function () {
|
|
selection.call(iD.svgIcon('#iD-icon-bug'));
|
|
expect(selection.select('svg').classed('icon')).to.be.true;
|
|
expect(selection.select('use').attr('xlink:href')).to.eql('#iD-icon-bug');
|
|
});
|
|
|
|
it('classes the \'svg\' and \'use\' elements', function () {
|
|
selection.call(iD.svgIcon('#iD-icon-bug', 'svg-class', 'use-class'));
|
|
expect(selection.select('svg').classed('icon svg-class')).to.be.true;
|
|
expect(selection.select('use').classed('use-class')).to.be.true;
|
|
});
|
|
});
|