From 27bd37dfc837c5b6a0298c77276f37f05a2d40c8 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Tue, 8 May 2018 22:33:55 +0200 Subject: [PATCH] test(router): fix tests --- core/src/components/router/test/e2e.spec.tsx | 5 ++--- core/src/components/router/test/parser.spec.tsx | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/components/router/test/e2e.spec.tsx b/core/src/components/router/test/e2e.spec.tsx index 337e24609d..3571f99ffb 100644 --- a/core/src/components/router/test/e2e.spec.tsx +++ b/core/src/components/router/test/e2e.spec.tsx @@ -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']); diff --git a/core/src/components/router/test/parser.spec.tsx b/core/src/components/router/test/parser.spec.tsx index 607cae7cea..b0579eee01 100644 --- a/core/src/components/router/test/parser.spec.tsx +++ b/core/src/components/router/test/parser.spec.tsx @@ -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); }); });