test(router): fix tests

This commit is contained in:
Manu Mtz.-Almeida
2018-05-08 22:33:55 +02:00
parent 526c9a8f35
commit 27bd37dfc8
2 changed files with 4 additions and 5 deletions

View File

@@ -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']);

View File

@@ -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);
});
});