Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
test: add test for selected-css attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
greenyouse committed Jan 21, 2017
1 parent 9c92d4f commit 097ca1d
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion test/bottom-toolbar/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<test-fixture id="colors">
<template>
<bottom-nav>
<bottom-toolbar>
<bottom-toolbar selected="0">
<bottom-tab selected-class="purple"></bottom-tab>
<bottom-tab selected-class="yellow"></bottom-tab>
</bottom-toolbar>
Expand Down Expand Up @@ -192,6 +192,28 @@
});
});

suite('selected-css attribute', function() {
var tabs, tab;
var RIGHT = 39;

setup(function () {
tabs = fixture('colors');
});

test('selected-css attribute in sync with bottom-toolbar', function() {
var toolbar = tabs.querySelector('bottom-toolbar'),
classes = toolbar.classList;

assert.isTrue(classes.contains('purple'));

tab = tabs.querySelectorAll('bottom-tab')[1];
MockInteractions.tap(tab);

assert.isTrue(classes.contains('yellow'));
assert.isFalse(classes.contains('purple'));
});
});

suite('accessibility', function() {
var LEFT = 37;
var RIGHT = 39;
Expand Down

0 comments on commit 097ca1d

Please sign in to comment.