mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(router): fix tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { TestWindow } from '@stencil/core/dist/testing';
|
||||
import { RouteChain, RouteID } from '../utils/interface';
|
||||
import { routerIDsToChain, routerPathToChain } from '../utils/matching';
|
||||
import { flattenRouterTree, readRoutes } from '../utils/parser';
|
||||
import { readRoutes } from '../utils/parser';
|
||||
import { chainToPath, generatePath, parsePath } from '../utils/path';
|
||||
import { mockRouteElement } from './parser.spec';
|
||||
|
||||
@@ -9,8 +9,7 @@ describe('ionic-conference-app', () => {
|
||||
|
||||
it('should match conference-app routing', () => {
|
||||
const root = conferenceAppRouting();
|
||||
const tree = readRoutes(root);
|
||||
const routes = flattenRouterTree(tree);
|
||||
const routes = readRoutes(root);
|
||||
|
||||
expect(getRouteIDs('/', routes)).toEqual(['page-tabs', 'tab-schedule', 'page-schedule']);
|
||||
expect(getRouteIDs('/speaker', routes)).toEqual(['page-tabs', 'tab-speaker', 'page-speaker-list']);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { TestWindow } from '@stencil/core/dist/testing';
|
||||
import { RouteRedirect, RouteTree } from '../utils/interface';
|
||||
import { flattenRouterTree, readRedirects, readRoutes } from '../utils/parser';
|
||||
import { flattenRouterTree, readRedirects, readRouteNodes } from '../utils/parser';
|
||||
|
||||
describe('parser', () => {
|
||||
|
||||
@@ -31,7 +31,7 @@ describe('parser', () => {
|
||||
] }
|
||||
] }
|
||||
];
|
||||
expect(readRoutes(root)).toEqual(expected);
|
||||
expect(readRouteNodes(root)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user