-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Angular 9. Bump version (v0.4.0) (#19)
* Separate Angular versions * Apply @enten changes * Use npx * Refactoring * Refactoring, adding Angular 8 case * Requested changes, bump version (v0.4.0) * Requested changes: error messages
- Loading branch information
Showing
47 changed files
with
741 additions
and
132 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,43 @@ | ||
import { AngularSelector, waitForAngular } from '../lib'; | ||
|
||
fixture `AngularSelector` | ||
.page('http://localhost:8080/test/data/angular') | ||
.beforeEach(async () => { | ||
await waitForAngular(); | ||
runTests('AngularSelector (Angular v4)', 'http://localhost:8080/test/data/angular-4'); | ||
runTests('AngularSelector (Angular v8)', 'http://localhost:8080/test/data/angular-8/dist/index-aot.html'); | ||
runTests('AngularSelector (Angular v9)', 'http://localhost:8080/test/data/angular-9/dist/index-aot.html'); | ||
|
||
function runTests (fixtureLabel, pageUrl) { | ||
fixture(fixtureLabel) | ||
.page(pageUrl) | ||
.beforeEach(async () => { | ||
await waitForAngular(); | ||
}); | ||
|
||
test('root', async t => { | ||
const root = AngularSelector(); | ||
const rootAngular = await root.getAngular(); | ||
|
||
await t | ||
.expect(root.exists).ok() | ||
.expect(rootAngular.rootProp1).eql(1); | ||
|
||
await t.expect(rootAngular.hasOwnProperty('__ngContext__')).notOk(); | ||
}); | ||
|
||
test('root', async t => { | ||
const root = AngularSelector(); | ||
const rootAngular = await root.getAngular(); | ||
test('selector', async t => { | ||
const list = AngularSelector('list'); | ||
const listAngular = await list.getAngular(); | ||
|
||
await t | ||
.expect(root.exists).ok() | ||
.expect(rootAngular.rootProp1).eql(1); | ||
}); | ||
|
||
test('selector', async t => { | ||
const list = AngularSelector('list'); | ||
const listAngular = await list.getAngular(); | ||
|
||
await t.expect(list.count).eql(2) | ||
.expect(AngularSelector('list-item').count).eql(6) | ||
.expect(listAngular.id).eql('list1'); | ||
}); | ||
|
||
test('composite selector', async t => { | ||
const listItem = AngularSelector('list list-item'); | ||
const listItemAngular6 = await listItem.nth(5).getAngular(); | ||
const listItemAngular5Id = listItem.nth(4).getAngular(({ state }) => state.id); | ||
await t.expect(list.count).eql(2) | ||
.expect(AngularSelector('list-item').count).eql(6) | ||
.expect(listAngular.id).eql('list1'); | ||
}); | ||
|
||
await t.expect(listItem.count).eql(6) | ||
.expect(listItemAngular6.id).eql('list2-item3') | ||
.expect(listItemAngular5Id).eql('list2-item2'); | ||
}); | ||
test('composite selector', async t => { | ||
const listItem = AngularSelector('list list-item'); | ||
const listItemAngular6 = await listItem.nth(5).getAngular(); | ||
const listItemAngular5Id = listItem.nth(4).getAngular(({ state }) => state.id); | ||
|
||
await t.expect(listItem.count).eql(6) | ||
.expect(listItemAngular6.id).eql('list2-item3') | ||
.expect(listItemAngular5Id).eql('list2-item2'); | ||
}); | ||
} |
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
Oops, something went wrong.