-
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.
Merge pull request #374 from san650/change-collection-signature
Change collection signature
- Loading branch information
Showing
6 changed files
with
108 additions
and
89 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
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,38 @@ | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
|
||
import { create, collection } from 'ember-cli-page-object'; | ||
|
||
moduleForComponent('calculating-device', 'Deprecation | legacy collection', { | ||
integration: true | ||
}); | ||
|
||
test('shows deprecation warning when first parameter is not a string', 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("doesn't show a deprecation warning when first parameter is a string", function(assert) { | ||
let page = create({ | ||
foo: collection('foo') | ||
}); | ||
|
||
page.foo; | ||
|
||
assert.expectNoDeprecation(); | ||
}); | ||
|
||
test('shows a warning on invalid legacy collection definitions', function(assert) { | ||
assert.expectWarning(function() { | ||
create({ | ||
foo: collection({ | ||
}) | ||
}); | ||
}, 'Legacy page object collection definition is invalid. Please, make sure you include a `itemScope` selector.'); | ||
}); |
Oops, something went wrong.