Skip to content

Commit

Permalink
WIP lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth G. Franqueiro committed Aug 6, 2018
1 parent fcfb30a commit 67016f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/mdc-tab-bar/foundation.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ class MDCTabBarFoundation extends MDCFoundation {
return;
}

let index = this.determineTargetFromKey_(this.adapter_.getActiveTabIndex(), key);
const index = this.determineTargetFromKey_(this.adapter_.getActiveTabIndex(), key);
this.activateTab(index);
this.scrollIntoView(index);
} else {
const focusedTabIndex = this.adapter_.getFocusedTabIndex();
if (this.isActivationKey_(key)) {
this.activateTab(focusedTabIndex);
} else {
let index = this.determineTargetFromKey_(focusedTabIndex, key);
const index = this.determineTargetFromKey_(focusedTabIndex, key);
this.adapter_.focusTabAtIndex(index);
this.scrollIntoView(index);
}
Expand Down
6 changes: 3 additions & 3 deletions test/unit/mdc-tab-bar/foundation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ test('#handleTabInteraction() activates the tab', () => {
});

test('#handleKeyDown() focuses the tab at the 0th index on home key press', () => {
const {foundation, activateTab, mockAdapter} = setupKeyDownTest();
const {foundation, mockAdapter} = setupKeyDownTest();
const {fakeEvent: fakeKeyEvent} = mockKeyDownEvent({key: MDCTabBarFoundation.strings.HOME_KEY});
const {fakeEvent: fakeKeyCodeEvent} = mockKeyDownEvent({keyCode: 36});
td.when(mockAdapter.getFocusedTabIndex()).thenReturn(2);
Expand All @@ -94,7 +94,7 @@ test('#handleKeyDown() focuses the tab at the 0th index on home key press', () =
});

test('#handleKeyDown() focuses the tab at the N - 1 index on end key press', () => {
const {foundation, mockAdapter, activateTab} = setupKeyDownTest();
const {foundation, mockAdapter} = setupKeyDownTest();
const {fakeEvent: fakeKeyEvent} = mockKeyDownEvent({key: MDCTabBarFoundation.strings.END_KEY});
const {fakeEvent: fakeKeyCodeEvent} = mockKeyDownEvent({keyCode: 35});
td.when(mockAdapter.getFocusedTabIndex()).thenReturn(2);
Expand All @@ -105,7 +105,7 @@ test('#handleKeyDown() focuses the tab at the N - 1 index on end key press', ()
});

test('#handleKeyDown() focuses the tab at the previous index on left arrow press', () => {
const {foundation, mockAdapter, activateTab} = setupKeyDownTest();
const {foundation, mockAdapter} = setupKeyDownTest();
const {fakeEvent: fakeKeyEvent} = mockKeyDownEvent({key: MDCTabBarFoundation.strings.ARROW_LEFT_KEY});
const {fakeEvent: fakeKeyCodeEvent} = mockKeyDownEvent({keyCode: 37});
td.when(mockAdapter.getFocusedTabIndex()).thenReturn(2);
Expand Down

0 comments on commit 67016f8

Please sign in to comment.