-
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.
- Loading branch information
Showing
9 changed files
with
126 additions
and
49 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
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 |
---|---|---|
@@ -1,38 +1,42 @@ | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import { module, test } from 'ember-qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
import { create, collection } from 'ember-cli-page-object'; | ||
|
||
moduleForComponent('calculating-device', 'Deprecation | legacy collection', { | ||
integration: true | ||
}); | ||
import require from 'require'; | ||
if (require.has('@ember/test-helpers')) { | ||
module('Deprecation | legacy collection', function(hooks) { | ||
setupTest(hooks); | ||
|
||
test('shows deprecation warning when first parameter is not a string', function(assert) { | ||
let page = create({ | ||
foo: collection({ | ||
itemScope: 'li' | ||
}) | ||
}); | ||
test('shows deprecation warning when first parameter is not a string', function(assert) { | ||
let page = create({ | ||
foo: collection({ | ||
itemScope: 'li' | ||
}) | ||
}); | ||
|
||
page.foo(); | ||
page.foo(); | ||
|
||
assert.expectDeprecation('You are currently using the legacy collection API, check the documentation to see how to upgrade to the new API.'); | ||
}); | ||
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') | ||
}); | ||
test("doesn't show a deprecation warning when first parameter is a string", function(assert) { | ||
let page = create({ | ||
foo: collection('foo') | ||
}); | ||
|
||
page.foo; | ||
page.foo; | ||
|
||
assert.expectNoDeprecation(); | ||
}); | ||
assert.expectNoDeprecation(); | ||
}); | ||
|
||
test('shows a warning on invalid legacy collection definitions', function(assert) { | ||
assert.expectWarning(function() { | ||
create({ | ||
foo: collection({ | ||
}) | ||
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.'); | ||
}); | ||
}, 'Legacy page object collection definition is invalid. Please, make sure you include a `itemScope` selector.'); | ||
}); | ||
}); | ||
} |
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,23 @@ | ||
import { module, test } from 'qunit'; | ||
import { create } from 'ember-cli-page-object'; | ||
import require from 'require'; | ||
|
||
if (require.has('@ember/test-helpers')) { | ||
const DEPRECATION_MESSAGE = 'setContext() is deprecated. Please make sure you use "@ember/test-helpers" of v1 or higher.'; | ||
|
||
module('Deprecation | setContext', function() { | ||
test('passing page context to create is deprecated', function(assert) { | ||
this.page = create().setContext(this); | ||
|
||
assert.expectDeprecation(DEPRECATION_MESSAGE) | ||
}); | ||
|
||
test('passing page context to create is deprecated', function(assert) { | ||
this.page = create({ | ||
context: this | ||
}); | ||
|
||
assert.expectDeprecation(DEPRECATION_MESSAGE) | ||
}); | ||
}); | ||
} |
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