OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 cr.define('md_history.history_routing_test', function() { | |
6 function registerTests() { | |
7 suite('synced-tabs', function() { | |
tsergeant
2016/07/15 03:56:14
Nit: Rename this suite.
calamity
2016/07/15 06:22:02
Done.
| |
8 var app; | |
9 var list; | |
10 | |
11 suiteSetup(function() { | |
12 app = $('history-app'); | |
13 sidebar = app.$['side-bar'] | |
14 }); | |
15 | |
16 test('changing route changes active view', function() { | |
17 assertEquals('history', app.$.content.selected); | |
18 app.set('routeData_.page', 'syncedTabs'); | |
19 return flush().then(function() { | |
20 assertEquals('syncedTabs', app.$.content.selected); | |
tsergeant
2016/07/15 03:56:14
Nit: Maybe assert that the URL is correct?
calamity
2016/07/15 06:22:02
Done.
| |
21 }); | |
22 }); | |
23 | |
24 test('route updates from sidebar', function() { | |
25 var menu = sidebar.$.menu; | |
26 assertEquals('', app.routeData_.page); | |
27 | |
28 MockInteractions.tap(menu.children[1]); | |
29 assertEquals('syncedTabs', app.routeData_.page); | |
30 | |
31 MockInteractions.tap(menu.children[0]); | |
32 assertEquals('', app.routeData_.page); | |
33 }); | |
34 | |
35 teardown(function() { | |
36 app.set('routeData_.page', ''); | |
37 }); | |
38 }); | |
39 } | |
40 return { | |
41 registerTests: registerTests | |
42 }; | |
43 }); | |
OLD | NEW |