ember-cli-page-object icon indicating copy to clipboard operation
ember-cli-page-object copied to clipboard

Use 'includes' instead of 'contains'?

Open danwenzel opened this issue 7 years ago • 4 comments

JS convention seems to have moved toward using the method name includes instead of contains. For enumerables, Ember is deprecating contains, and includes is pretty much the only available method on JS strings.

Shouldn't ember-cli-page-object follow this same convention, and use includes here instead of contains? http://ember-cli-page-object.js.org/docs/v1.13.x/api/contains

danwenzel avatar Feb 13 '18 22:02 danwenzel

@danwenzel I like the suggestion!

If we do this, we should deprecate contains first and make includes available. We could drop de deprecation in v2.0

san650 avatar Feb 14 '18 14:02 san650

includes is not supported in IE (incase we are supporting it) can we go with good old indexOf?

mum-never-proud avatar Mar 30 '20 00:03 mum-never-proud

@mum-never-proud - I am referring to ember-cli-page-object's method names

danwenzel avatar Jun 16 '20 18:06 danwenzel

I think we should deprecate contains((after v2 is released) without making new includes( API. Users can directly use built-in string method, like myNode.text.includes('something')

ro0gr avatar Feb 22 '23 23:02 ro0gr