33describe ( 'geo.annotation' , function ( ) {
44 'use strict' ;
55
6- var $ = require ( 'jquery' ) ;
76 var geo = require ( '../test-utils' ) . geo ;
87 var createMap = require ( '../test-utils' ) . createMap ;
98 var destroyMap = require ( '../test-utils' ) . destroyMap ;
@@ -1716,22 +1715,22 @@ describe('geo.annotation', function () {
17161715 var newshapeCount = 0 ;
17171716 it ( 'listAnnotations' , function ( ) {
17181717 var list = geo . listAnnotations ( ) ;
1719- expect ( $ . inArray ( 'rectangle' , list ) >= 0 ) . toBe ( true ) ;
1720- expect ( $ . inArray ( 'polygon' , list ) >= 0 ) . toBe ( true ) ;
1721- expect ( $ . inArray ( 'point' , list ) >= 0 ) . toBe ( true ) ;
1722- expect ( $ . inArray ( 'line' , list ) >= 0 ) . toBe ( true ) ;
1723- expect ( $ . inArray ( 'unknown' , list ) >= 0 ) . toBe ( false ) ;
1718+ expect ( list . includes ( 'rectangle' ) ) . toBe ( true ) ;
1719+ expect ( list . includes ( 'polygon' ) ) . toBe ( true ) ;
1720+ expect ( list . includes ( 'point' ) ) . toBe ( true ) ;
1721+ expect ( list . includes ( 'line' ) ) . toBe ( true ) ;
1722+ expect ( list . includes ( 'unknown' ) ) . toBe ( false ) ;
17241723 } ) ;
17251724 it ( 'registerAnnotation' , function ( ) {
17261725 var func = function ( ) { newshapeCount += 1 ; return 'newshape return' ; } ;
17271726 sinon . stub ( console , 'warn' ) . callsFake ( function ( ) { } ) ;
1728- expect ( $ . inArray ( 'newshape' , geo . listAnnotations ( ) ) >= 0 ) . toBe ( false ) ;
1727+ expect ( geo . listAnnotations ( ) . includes ( 'newshape' ) ) . toBe ( false ) ;
17291728 expect ( geo . registerAnnotation ( 'newshape' , func ) ) . toBe ( undefined ) ;
1730- expect ( $ . inArray ( 'newshape' , geo . listAnnotations ( ) ) >= 0 ) . toBe ( true ) ;
1729+ expect ( geo . listAnnotations ( ) . includes ( 'newshape' ) ) . toBe ( true ) ;
17311730 expect ( console . warn . calledOnce ) . toBe ( false ) ;
17321731 expect ( geo . registerAnnotation ( 'newshape' , func ) . func ) . toBe ( func ) ;
17331732 expect ( console . warn . calledOnce ) . toBe ( true ) ;
1734- expect ( $ . inArray ( 'newshape' , geo . listAnnotations ( ) ) >= 0 ) . toBe ( true ) ;
1733+ expect ( geo . listAnnotations ( ) . includes ( 'newshape' ) ) . toBe ( true ) ;
17351734 console . warn . restore ( ) ;
17361735 } ) ;
17371736 it ( 'createAnnotation' , function ( ) {
@@ -1745,29 +1744,29 @@ describe('geo.annotation', function () {
17451744 } ) ;
17461745 it ( 'featuresForAnnotations' , function ( ) {
17471746 var features = geo . featuresForAnnotations ( [ 'polygon' ] ) ;
1748- expect ( $ . inArray ( 'polygon' , features ) >= 0 ) . toBe ( true ) ;
1749- expect ( $ . inArray ( 'line.basic' , features ) >= 0 ) . toBe ( true ) ;
1750- expect ( $ . inArray ( 'point' , features ) >= 0 ) . toBe ( false ) ;
1747+ expect ( features . includes ( 'polygon' ) ) . toBe ( true ) ;
1748+ expect ( features . includes ( 'line.basic' ) ) . toBe ( true ) ;
1749+ expect ( features . includes ( 'point' ) ) . toBe ( false ) ;
17511750 features = geo . featuresForAnnotations ( { polygon : true } ) ;
1752- expect ( $ . inArray ( 'polygon' , features ) >= 0 ) . toBe ( true ) ;
1753- expect ( $ . inArray ( 'line.basic' , features ) >= 0 ) . toBe ( true ) ;
1754- expect ( $ . inArray ( 'point' , features ) >= 0 ) . toBe ( false ) ;
1751+ expect ( features . includes ( 'polygon' ) ) . toBe ( true ) ;
1752+ expect ( features . includes ( 'line.basic' ) ) . toBe ( true ) ;
1753+ expect ( features . includes ( 'point' ) ) . toBe ( false ) ;
17551754 features = geo . featuresForAnnotations ( { polygon : [ geo . annotation . state . done ] } ) ;
1756- expect ( $ . inArray ( 'polygon' , features ) >= 0 ) . toBe ( true ) ;
1757- expect ( $ . inArray ( 'line.basic' , features ) >= 0 ) . toBe ( false ) ;
1758- expect ( $ . inArray ( 'point' , features ) >= 0 ) . toBe ( false ) ;
1755+ expect ( features . includes ( 'polygon' ) ) . toBe ( true ) ;
1756+ expect ( features . includes ( 'line.basic' ) ) . toBe ( false ) ;
1757+ expect ( features . includes ( 'point' ) ) . toBe ( false ) ;
17591758 features = geo . featuresForAnnotations ( { polygon : [ geo . annotation . state . done , geo . annotation . state . create ] } ) ;
1760- expect ( $ . inArray ( 'polygon' , features ) >= 0 ) . toBe ( true ) ;
1761- expect ( $ . inArray ( 'line.basic' , features ) >= 0 ) . toBe ( true ) ;
1762- expect ( $ . inArray ( 'point' , features ) >= 0 ) . toBe ( false ) ;
1759+ expect ( features . includes ( 'polygon' ) ) . toBe ( true ) ;
1760+ expect ( features . includes ( 'line.basic' ) ) . toBe ( true ) ;
1761+ expect ( features . includes ( 'point' ) ) . toBe ( false ) ;
17631762 features = geo . featuresForAnnotations ( [ 'polygon' , 'point' ] ) ;
1764- expect ( $ . inArray ( 'polygon' , features ) >= 0 ) . toBe ( true ) ;
1765- expect ( $ . inArray ( 'line.basic' , features ) >= 0 ) . toBe ( true ) ;
1766- expect ( $ . inArray ( 'point' , features ) >= 0 ) . toBe ( true ) ;
1763+ expect ( features . includes ( 'polygon' ) ) . toBe ( true ) ;
1764+ expect ( features . includes ( 'line.basic' ) ) . toBe ( true ) ;
1765+ expect ( features . includes ( 'point' ) ) . toBe ( true ) ;
17671766 features = geo . featuresForAnnotations ( [ 'polygon' , 'unknown' ] ) ;
1768- expect ( $ . inArray ( 'polygon' , features ) >= 0 ) . toBe ( true ) ;
1769- expect ( $ . inArray ( 'line.basic' , features ) >= 0 ) . toBe ( true ) ;
1770- expect ( $ . inArray ( 'point' , features ) >= 0 ) . toBe ( false ) ;
1767+ expect ( features . includes ( 'polygon' ) ) . toBe ( true ) ;
1768+ expect ( features . includes ( 'line.basic' ) ) . toBe ( true ) ;
1769+ expect ( features . includes ( 'point' ) ) . toBe ( false ) ;
17711770 } ) ;
17721771 it ( 'rendererForAnnotations' , function ( ) {
17731772 sinon . stub ( console , 'warn' ) . callsFake ( function ( ) { } ) ;
0 commit comments