Skip to content

Commit 59e408a

Browse files
committed
[docs] Add deprecation section for "is" property
1 parent b8c354d commit 59e408a

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

addon-test-support/properties/is.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export function is(testSelector, targetSelector, userOptions = {}) {
5454
get(key) {
5555
deprecate(':is property is deprecated', false, {
5656
id: 'ember-cli-page-object.is-property',
57-
until: '2.0.0'
57+
until: '2.0.0',
58+
url: 'https://ember-cli-page-object.js.org/docs/v1.16.x/deprecations/#is-property',
5859
});
5960

6061
let options = assign({ pageObjectKey: key }, userOptions);

guides/deprecations.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,46 @@ title: Deprecations
55

66
This is a list of deprecations introduced in 1.x cycle:
77

8+
## Is property
9+
10+
**ID**: ember-cli-page-object.is-property
11+
12+
**Until**: 2.0.0
13+
14+
In scope of gradual reducing of jQuery APIs exposed directly to the user, we no longer recommend to use `is` property, and plan to remove it in v2 of page objects.
15+
16+
The most common use cases for `is(` are covered with a `property` helper. Please use it instead.
17+
18+
Bad:
19+
20+
```js
21+
import { create, is } from 'ember-cli-page-object';
22+
23+
const page = create({
24+
scope: 'input',
25+
26+
isChecked: is(':checked'),
27+
28+
isDisabled: is(':disabled')
29+
});
30+
```
31+
32+
Good:
33+
34+
```js
35+
import { create, property } from 'ember-cli-page-object';
36+
37+
const page = create({
38+
scope: 'input',
39+
40+
isChecked: property('checked'),
41+
42+
isDisabled: property('disabled')
43+
})
44+
```
45+
46+
In case there is no built-in replacement for `is` in ember-cli-page-object, you can write your custom getter property, to achieve behavior you need.
47+
848
## Set context
949

1050
**ID**: ember-cli-page-object.set-context

0 commit comments

Comments
 (0)