-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use legacy collection in corner case
Also, link to migration guide in legacy collection warnings.
- Loading branch information
Showing
3 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
|
||
import { create, collection } from 'ember-cli-page-object'; | ||
|
||
moduleForComponent('calculating-device', 'Deprecation | legacy collection', { | ||
integration: true | ||
}); | ||
|
||
test('usage of itemScope in definition leads to the deprecation', function(assert) { | ||
let page = create({ | ||
foo: collection({ | ||
itemScope: 'li' | ||
}) | ||
}); | ||
|
||
page.foo(); | ||
|
||
assert.expectDeprecation('You are currently using the legacy collection API, check the documentation to see how to upgrade to the new API.'); | ||
}); | ||
|
||
test('usage of scope plus item leads to the deprecation', function(assert) { | ||
let page = create({ | ||
foo: collection({ | ||
scope: 'foo', | ||
item: {} | ||
}) | ||
}); | ||
|
||
page.foo(); | ||
|
||
assert.expectDeprecation('You are currently using the legacy collection API, check the documentation to see how to upgrade to the new API.'); | ||
}); | ||
|
||
test('usage of scope without item does not lead to the deprecation', function(assert) { | ||
let page = create({ | ||
foo: collection({ | ||
scope: 'foo', | ||
bar: {} | ||
}) | ||
}); | ||
|
||
page.foo; | ||
|
||
assert.expectNoDeprecation(); | ||
}); |