Comments (1)
The test is failing due to the following line of code not returning the excepted value for els_count
:
var els = $('img,div'),
els_count = els.find('img[usemap]').length,
When running under zepto, els_count
is two (2) rather than the excepted one (1) because Zepto returns all elements found from find rather than a unique element list.
The simple solution would be to adjust as follows:
var els = $('img,div'),
found_els = els.find('img[usemap]'),
els_count = $.zepto ? $.zepto.uniq(found_els) : found_els,
However, what this code is attempting to do is wait for configured to be called on every 'found' element that is an imagemap. Currently, we know there is only one actual imagemap under test and all other tests are written with that assumption so having this logic here doesn't add any value. If/When tests are updated to have multiple imagemaps under test on a single page, all test code will need to be adjusted to wait until all maps are 'configured' before continuing.
The intent of this particular test is to ensure that even when non-imagemap elements are passed in to mapster for initialization, only img
elements with usemap
are actually processed by imagemapster. We can do a more accurate job of actually testing this behavior by having other img
and div
elements on the test page and then the current assert will actually verify only one img
was actually processed as an imagemap.
from imagemapster.
Related Issues (20)
- onGetList not called when isSelectable !== true
- tests not waiting for onConfigured before continuing
- [📘] rebind docs are not correct regarding preserving selected state
- jsFiddle demos are all broken HOT 6
- Incorrect reference to navigateMode config option name
- Safari's OCR/Live Text is blocking image zones HOT 3
- [TouchScreen only] Weird highlight glitch when touch on the other area beside the map. HOT 5
- this.activeToolTip.stop is not a function HOT 2
- Export image HOT 1
- Tooltip is inconsistent, it shows up on most areas but does not on couple of area item. HOT 5
- [🐞] `navigate` example pages are unresponsive HOT 1
- [🐞] grunt `docco` task failing with `Fatal error: marked is not a function` HOT 1
- [✨] Improve ability to run tests with all supported libraries & versions
- [🐞] `configTimeout` not respected for value specified
- [✨] Add ESM support
- [🐞] `fadeDuration` specified in `area options` is not honored for tooltips
- [🐞] Forgotten console.log in v1.7.0 HOT 1
- [🐞] resizing map when map not visible causes `Failed to execute 'drawImage' on 'CanvasRenderingContext2D'` exception
- [🐞] exception `TypeError: Cannot read properties of null (reading '5')` encountered after `unbind`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagemapster.