-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(router-outlet): getRouteId() returns the params set in setRouteId().
- Loading branch information
Showing
5 changed files
with
48 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
test('getRouteId() should return the segment parameters', async () => { | ||
const page = await newE2EPage({ | ||
url: '/src/components/router-outlet/test/basic?ionic:_testing=true' | ||
}); | ||
|
||
|
||
await page.$eval('ion-item[href="#/two/segment"] ion-label', (el: any) => el.click()); | ||
await page.waitForChanges(); | ||
const routeId = await page.$eval('ion-router-outlet', async (el: any) => await el.getRouteId()); | ||
|
||
expect(routeId.id).toEqual('PAGE-TWO'); | ||
expect(routeId.params).toEqual({ param: 'segment' }); | ||
}); | ||
|
||
test('getRouteId() should return the route parameters', async () => { | ||
const page = await newE2EPage({ | ||
url: '/src/components/router-outlet/test/basic?ionic:_testing=true' | ||
}); | ||
|
||
|
||
await page.$eval('ion-item[href="#/page-3"] ion-label', (el: any) => el.click()); | ||
await page.waitForChanges(); | ||
const routeId = await page.$eval('ion-router-outlet', async (el: any) => await el.getRouteId()); | ||
|
||
expect(routeId.id).toEqual('PAGE-THREE'); | ||
expect(routeId.params).toEqual({ param: 'route' }); | ||
}); |
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